Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply 1:1 conversions from std -> no_std #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mooman219
Copy link

@mooman219 mooman219 commented Dec 28, 2021

Initial work for #88.

Apply equivalent 1 to 1 conversions. Dependencies alloc and hashbrown are added. These are also dependencies in std. This doesn't make any API or logic changes, just a dependency cleanup.

There is not default format config, rustfmt.toml on this project. Is that intentional? I'd be happy to re-format if you push some config you like.

@mooman219 mooman219 changed the title Apply 1:1 conversions Apply 1:1 conversions from std -> no_std Dec 28, 2021
@pdeljanov
Copy link
Owner

Hi @mooman219,

Thanks for taking on this task. I'm sure there will be many people who appreciate this work!

Is there a way to do this conversion without having to invoke rustfmt?

The reason why there is no config is because I generally just don't want anyone to run rustfmt until I settle on a proper configuration. However, there are some challenges. First, many of the configuration options I'd like to use are nightly only (e.g., control_brace_style). Second, last time I checked there wasn't a very good way to vertically align things. Third, I need to go through the code and insert #[rustfmt::skip] where it belongs (such as on some big tables) which is a time consuming process.

Aside from that, having formatting changes in this PR also makes it difficult for me to review what has actually meaningfully changed.

Thanks!

@mooman219
Copy link
Author

Hey @pdeljanov,

That's reasonable, here is it without formatting.


For fixed indentation I usually just format the code to force a desired wrapping:

pub const IDENTITY_MATRIX: Matrix4<f32> = Matrix4::new(
    1.0, 0.0, 0.0, 0.0, //
    0.0, 1.0, 0.0, 0.0, //
    0.0, 0.0, 1.0, 0.0, //
    0.0, 0.0, 0.0, 1.0, //
);

@pdeljanov
Copy link
Owner

pdeljanov commented Dec 30, 2021

Hey @mooman219,

Thanks! This looks a fairly straightforward and clear change. Thanks for that tip as well, very clever!

I missed your last reply to the issue you raised for this. I've left a reply now. For now I'll leave this PR open until we decide on the best way forward. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants