Skip to content

Improve src/lib.rs cfgs #119

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

Merged
merged 1 commit into from
Oct 25, 2019
Merged

Improve src/lib.rs cfgs #119

merged 1 commit into from
Oct 25, 2019

Conversation

josephlr
Copy link
Member

Suggested by @newpavlov here: #116 (comment)

Right now for each of util_libc and use_file we have a list of
target_os configs to determine if we build the module.

This PR moves these mod declarations into the main cfg_if statement
(the one that selects which implementation we use). This way, the mod
statements are kept in-sync with the implementations that use them.

Also, I merged together target_os cfgs that have the same
implementation. The downside to this is that the targets are no longer
in alphabetical order.

Also, this is only being applied to 0.2 as the 0.1 cfgs still have
to keep std around.

Right now for each of `util_libc` and `use_file` we have a list of
`target_os` configs to determine if we build the module.

This PR moves these mod declarations into the main `cfg_if` statement
(the one that selects which implementation we use). This way, the mod
statements are kept in-sync with the implementations that use them.

Also, I merged together `target_os` cfgs that have the same
implementation. The downside to this is that the targets are no longer
in alphabetical order.

Also, this is only being applied to `0.2` as the `0.1` cfgs still have
to keep `std` around.
@newpavlov
Copy link
Member

Suggested by @newpavlov here

Well, to be fair the main idea is yours. :)

@newpavlov newpavlov merged commit cf2d81b into rust-random:0.2 Oct 25, 2019
@josephlr josephlr deleted the libc branch October 25, 2019 20:52
@josephlr josephlr added this to the 0.2 milestone Jan 9, 2020
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.

2 participants