use std by default #130

Merged
kinggoesgaming merged 10 commits from default-std into master 2018-02-03 23:25:55 -06:00
kinggoesgaming commented 2018-02-03 17:11:08 -06:00 (Migrated from github.com)

closes #123

closes #123
radix (Migrated from github.com) reviewed 2018-02-03 17:11:08 -06:00
Dylan-DPC-zz (Migrated from github.com) reviewed 2018-02-03 17:11:08 -06:00
kinggoesgaming commented 2018-02-03 17:18:04 -06:00 (Migrated from github.com)

documentation still needs to be updated

Edit: done

documentation still needs to be updated Edit: done
KodrAus (Migrated from github.com) reviewed 2018-02-03 18:51:59 -06:00
@ -26,12 +26,10 @@
//!
KodrAus (Migrated from github.com) commented 2018-02-03 18:31:57 -06:00

nit: We could probably just say std instead of libstd.

nit: We could probably just say `std` instead of `libstd`.
KodrAus (Migrated from github.com) commented 2018-02-03 18:33:47 -06:00

We can probably just remove std from this list, since we're implying that you need to enable these features to get functionality,

We can probably just remove `std` from this list, since we're implying that you need to enable these features to get functionality,
@ -104,3 +109,3 @@
#![deny(warnings)]
#![no_std]
#![cfg_attr(not(feature = "std"), no_std)]
KodrAus (Migrated from github.com) commented 2018-02-03 18:50:02 -06:00

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 👍

I don't think this will work when compiling with `no_std`. Instead we might need to do something like: ```rust #[cfg(feature = "std")] extern crate std as core; ``` **EDIT:** Nevermind, you fixed it already :+1:
KodrAus (Migrated from github.com) reviewed 2018-02-03 19:14:32 -06:00
@ -104,3 +109,3 @@
#![deny(warnings)]
#![no_std]
#![cfg_attr(not(feature = "std"), no_std)]
KodrAus (Migrated from github.com) commented 2018-02-03 19:14:32 -06:00

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.

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: ```toml serde = { version = "1.0.16", optional = true, default-features = false } ``` And then include core in `lib.rs` as: ```rust #[cfg(feature = "std")] extern crate std as core; ``` Then `no_std` users can use `uuid` with `serde`.
kinggoesgaming commented 2018-02-03 21:52:48 -06:00 (Migrated from github.com)

@KodrAus this should ready to go unless you any more nitpicks :)

@KodrAus this should ready to go unless you any more nitpicks :)
KodrAus commented 2018-02-03 22:49:15 -06:00 (Migrated from github.com)

Thanks @kinggoesgaming! Just one more comment:

We can change the attribute pulling in the std_support module to only require the std feature instead of also including serde.

Thanks @kinggoesgaming! Just one more comment: We can change the attribute pulling in the `std_support` module to only require the `std` feature instead of also including `serde`.
kinggoesgaming commented 2018-02-03 23:07:25 -06:00 (Migrated from github.com)

@KodrAus done

@KodrAus done
KodrAus (Migrated from github.com) approved these changes 2018-02-03 23:19:57 -06:00
KodrAus commented 2018-02-03 23:20:54 -06:00 (Migrated from github.com)

This looks good to me!

bors r+

This looks good to me! bors r+
bors[bot] commented 2018-02-03 23:25:54 -06:00 (Migrated from github.com)
# Build succeeded * [continuous-integration/appveyor/branch](https://ci.appveyor.com/project/KodrAus/uuid/build/1.0.62) * [continuous-integration/travis-ci/push](https://travis-ci.org/uuid-rs/uuid/builds/337122791?utm_source=github_status&utm_medium=notification)
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid!130
No description provided.