-
Notifications
You must be signed in to change notification settings - Fork 221
Use cfg-if to create logical feature gate implementations #167
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
Conversation
* [x] `extern crate`s * [x] already provided `mod`s Signed-off-by: Hunar Roop Kahlon <[email protected]>
Signed-off-by: Hunar Roop Kahlon <[email protected]>
Signed-off-by: Hunar Roop Kahlon <[email protected]>
Signed-off-by: Hunar Roop Kahlon <[email protected]>
Signed-off-by: Hunar Roop Kahlon <[email protected]>
Signed-off-by: Hunar Roop Kahlon <[email protected]>
|
question: should I put various feature gated constructor |
|
@uuid-rs/uuid I think this is logical enough for this PR. Should be ready for review and merge |
KodrAus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot easier to follow! Just had a quick scan through on mobile
| } | ||
| } | ||
|
|
||
| cfg_if! { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could reduce some duplicated nesting here by conditionally using core as std:
if #[cfg(not(feature = "std"))] {
use core as std;
}
use std::fmt;
use std::str;
...What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was intended to switch to cfg_if. Another PR should make the that part more readable later... which I think I will have ready soon
|
bors: r+ |
167: Use cfg-if to create logical feature gate implementations r=Dylan-DPC a=kinggoesgaming
<!--
As we are working towards a stable version of uuid, we require that you
open an issue, before submitting a pull request. If the pull request is
imcomplete, prepend the Title with WIP:
-->
**I'm submitting a ...**
- [ ] bug fix
- [ ] feature enhancement
- [ ] deprecation or removal
- [x] refactor
# Description
`uuid` now adds `cfg-if` as a dependency. With this, `#[cfg(..)]` implementations are easier to understand, as they can be handled in a more logical view because the macro allows us to `if` statements to make the checks more rustic at the source level
# Motivation
Understanding feature gate implementation becomes easier.
# Tests
The CI builds passing should be plenty.
# Related Issue(s)
#147
Build failed |
|
clippy was outdated, cache cleared bors r+ |
167: Use cfg-if to create logical feature gate implementations r=kinggoesgaming a=kinggoesgaming
<!--
As we are working towards a stable version of uuid, we require that you
open an issue, before submitting a pull request. If the pull request is
imcomplete, prepend the Title with WIP:
-->
**I'm submitting a ...**
- [ ] bug fix
- [ ] feature enhancement
- [ ] deprecation or removal
- [x] refactor
# Description
`uuid` now adds `cfg-if` as a dependency. With this, `#[cfg(..)]` implementations are easier to understand, as they can be handled in a more logical view because the macro allows us to `if` statements to make the checks more rustic at the source level
# Motivation
Understanding feature gate implementation becomes easier.
# Tests
The CI builds passing should be plenty.
# Related Issue(s)
#147
Build failed |
|
again! wrong cache cleared :( bors r+ |
167: Use cfg-if to create logical feature gate implementations r=kinggoesgaming a=kinggoesgaming
<!--
As we are working towards a stable version of uuid, we require that you
open an issue, before submitting a pull request. If the pull request is
imcomplete, prepend the Title with WIP:
-->
**I'm submitting a ...**
- [ ] bug fix
- [ ] feature enhancement
- [ ] deprecation or removal
- [x] refactor
# Description
`uuid` now adds `cfg-if` as a dependency. With this, `#[cfg(..)]` implementations are easier to understand, as they can be handled in a more logical view because the macro allows us to `if` statements to make the checks more rustic at the source level
# Motivation
Understanding feature gate implementation becomes easier.
# Tests
The CI builds passing should be plenty.
# Related Issue(s)
#147
I'm submitting a ...
Description
uuidnow addscfg-ifas a dependency. With this,#[cfg(..)]implementations are easier to understand, as they can be handled in a more logical view because the macro allows us toifstatements to make the checks more rustic at the source levelMotivation
Understanding feature gate implementation becomes easier.
Tests
The CI builds passing should be plenty.
Related Issue(s)
#147