-
Notifications
You must be signed in to change notification settings - Fork 192
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
use std by default #130
use std by default #130
Conversation
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
documentation still needs to be updated Edit: done |
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
added NDF variable, for --no-default-features Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
src/lib.rs
Outdated
//! This crate by default has no dependencies and is `#![no_std]` compatible. | ||
//! The following Cargo features, however, can be used to enable various pieces | ||
//! of functionality. | ||
//! By default, this crate depends on nothing but `libstd` and cannot generate |
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.
nit: We could probably just say std
instead of libstd
.
src/lib.rs
Outdated
//! of functionality. | ||
//! By default, this crate depends on nothing but `libstd` and cannot generate | ||
//! any `Uuid`s. You need to enable the following Cargo features to enable | ||
//! various pieces of functionality: | ||
//! | ||
//! * `std` - adds in functionality available when linking to the standard |
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.
We can probably just remove std
from this list, since we're implying that you need to enable these features to get functionality,
src/lib.rs
Outdated
// support in those situations as well. | ||
#[cfg(any(feature = "std", | ||
feature = "serde"))] | ||
extern crate core; |
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.
I don't think this will work when compiling with no_std
. Instead we might need to do something like:
#[cfg(feature = "std")]
extern crate std as core;
EDIT: Nevermind, you fixed it already 👍
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.
Actually, let's try and sort out our std
features. Right now, if you specify --no-default-features --features serde
you'll get a compile error from duplicate uses of core
.
We never need anything from serde
that uses std
though, so we could specify it in our Cargo.toml
as:
serde = { version = "1.0.16", optional = true, default-features = false }
And then include core in lib.rs
as:
#[cfg(feature = "std")]
extern crate std as core;
Then no_std
users can use uuid
with serde
.
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
@KodrAus this should ready to go unless you any more nitpicks :) |
Thanks @kinggoesgaming! Just one more comment: We can change the attribute pulling in the |
Signed-off-by: Hunar Roop Kahlon <hunar.roop@gmail.com>
@KodrAus done |
This looks good to me! bors r+ |
closes #123