From f657e5c2f49f04ac85c248267f12bba5ad9cbbc8 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Tue, 2 Nov 2021 10:28:28 +1000 Subject: [PATCH 1/2] prepare for 1.0.0-alpha.1 release --- Cargo.toml | 9 ++++----- README.md | 9 +++++++-- macros/Cargo.toml | 15 +++++++++++++-- src/lib.rs | 31 ++++++++++++++++++++++--------- src/macros.rs | 2 +- 5 files changed, 47 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f17c9012..a79f42c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,11 +30,10 @@ homepage = "https://github.com/uuid-rs/uuid" name = "uuid" readme = "README.md" repository = "https://github.com/uuid-rs/uuid" -version = "0.8.1" # remember to update html_root_url in lib.rs +version = "1.0.0-alpha.1" # remember to update html_root_url in lib.rs [package.metadata.docs.rs] -features = [ "serde", "slog", "v1", "v3", "v4", "v5" ] -default-target = "x86_64-pc-windows-msvc" +features = ["serde", "arbitrary", "slog", "v1", "v3", "v4", "v5"] [package.metadata.playground] features = ["serde", "v1", "v3", "v4", "v5"] @@ -54,7 +53,7 @@ repository = "uuid-rs/uuid" [features] default = ["std"] std = [] -macro-diagnostics = ["uuid_macro"] +macro-diagnostics = ["uuid-macro-internal"] v1 = ["atomic"] v3 = ["md-5"] @@ -98,7 +97,7 @@ optional = true version = "0.9" # Public: Re-exported -[dependencies.uuid_macro] +[dependencies.uuid-macro-internal] path = "macros" optional = true diff --git a/README.md b/README.md index 834c8bec..5990cd93 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ To get started with generating random UUIDs, add this to your `Cargo.toml`: ```toml [dependencies.uuid] -version = "0.8" +version = "1" features = ["v4", "fast-rng"] ``` @@ -113,6 +113,11 @@ flag through your environment to opt-in to unstable `uuid` features: RUSTFLAGS="--cfg uuid_unstable" ``` +## Minimum Supported Rust Version (MSRV) + +The minimum supported Rust version for `uuid` is documented in +CI. It may be bumped in minor releases as necessary. + ## References * [Wikipedia: Universally Unique Identifier]( http://en.wikipedia.org/wiki/Universally_unique_identifier) @@ -120,7 +125,7 @@ RUSTFLAGS="--cfg uuid_unstable" [`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen -[`Uuid`]: https://docs.rs/uuid/0.8.1/uuid/struct.Uuid.html +[`Uuid`]: https://docs.rs/uuid/1.0.0-alpha.1/uuid/struct.Uuid.html --- # License diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 3b0a3596..b6bbf852 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,7 +1,18 @@ [package] -name = "uuid_macro" -version = "0.0.0" +name = "uuid-macro-internal" +version = "1.0.0-alpha.1" edition = "2018" +authors = [ + "QnnOkabayashi" +] +categories = [ + "data-structures", + "no-std", + "parser-implementations", + "wasm" +] +description = "Private implementation details of the uuid! macro." +documentation = "https://docs.rs/uuid" [lib] proc-macro = true diff --git a/src/lib.rs b/src/lib.rs index f5bd2472..6de4f0be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,8 +35,13 @@ //! Add the following to your `Cargo.toml`: //! //! ```toml -//! [dependencies] -//! uuid = { version = "0.8", features = ["v4"] } +//! [dependencies.uuid] +//! version = "1.0.0-alpha.1" +//! features = [ +//! "v4", # Lets you generate random UUIDs +//! "fast-rng", # Use a faster (but still sufficiently random) RNG +//! "macro-diagnostics", # Enable better diagnostics for compile-time UUIDs +//! ] //! ``` //! //! When you want a UUID, you can generate one: @@ -52,6 +57,14 @@ //! # } //! ``` //! +//! If you have a UUID value you can use it inline: +//! +//! ``` +//! use uuid::{uuid, Uuid}; +//! +//! const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8"); +//! ``` +//! //! # Dependencies //! //! By default, this crate depends on nothing but `std` and can parse and format @@ -83,21 +96,21 @@ //! //! ```toml //! [dependencies] -//! uuid = "0.8" +//! uuid = "1" //! ``` //! //! To activate various features, use syntax like: //! //! ```toml //! [dependencies] -//! uuid = { version = "0.8", features = ["serde", "v4", "fast-rng"] } +//! uuid = { version = "1", features = ["serde", "v4", "fast-rng"] } //! ``` //! //! You can disable default features with: //! //! ```toml //! [dependencies] -//! uuid = { version = "0.8", default-features = false } +//! uuid = { version = "1", default-features = false } //! ``` //! //! ## Unstable features @@ -127,7 +140,7 @@ //! //! ```toml //! [dependencies] -//! uuid = { version = "0.8", features = ["v4", "js"] } +//! uuid = { version = "1", features = ["v4", "js"] } //! ``` //! //! You don't need the `js` feature to use `uuid` in WebAssembly if you're @@ -140,7 +153,7 @@ //! //! ```toml //! [dependencies] -//! uuid = { version = "0.8", default-features = false } +//! uuid = { version = "1", default-features = false } //! ``` //! //! Some additional features are supported in no-std environments though: @@ -203,7 +216,7 @@ #![doc( html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://www.rust-lang.org/favicon.ico", - html_root_url = "https://docs.rs/uuid/0.8.1" + html_root_url = "https://docs.rs/uuid/1.0.0-alpha.1" )] #[cfg(any(feature = "std", test))] @@ -246,7 +259,7 @@ mod macros; #[doc(hidden)] #[cfg(feature = "macro-diagnostics")] -pub extern crate uuid_macro; +pub extern crate uuid_macro_internal; use crate::std::convert; diff --git a/src/macros.rs b/src/macros.rs index 8be62d8a..66fd41c9 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -5,7 +5,7 @@ macro_rules! define_uuid_macro { #[macro_export] macro_rules! uuid { ($uuid:literal) => {{ - $crate::Uuid::from_bytes($crate::uuid_macro::parse_lit!($uuid)) + $crate::Uuid::from_bytes($crate::uuid_macro_internal::parse_lit!($uuid)) }}; } From 4e6412dadacb32613b4b76c94276613304cd6c6d Mon Sep 17 00:00:00 2001 From: Ashley Mannix Date: Tue, 16 Nov 2021 21:26:17 +1000 Subject: [PATCH 2/2] simplify macro examples a bit --- src/macros.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 66fd41c9..de200486 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -54,8 +54,8 @@ define_uuid_macro! { /// Defining a local variable: /// /// ``` -/// # use uuid::{uuid, Uuid}; -/// let uuid: Uuid = uuid!("urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4"); +/// # use uuid::uuid; +/// let uuid = uuid!("urn:uuid:F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4"); /// ``` /// /// ## Compilation Failures @@ -63,8 +63,8 @@ define_uuid_macro! { /// Invalid UUIDs are rejected: /// /// ```compile_fail -/// # use uuid::{uuid, Uuid}; -/// let uuid: Uuid = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4"); +/// # use uuid::uuid; +/// let uuid = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4"); /// ``` /// /// Enable the feature `macro-diagnostics` to see the error messages below. @@ -74,16 +74,16 @@ define_uuid_macro! { /// ```txt /// error: invalid character: expected an optional prefix of `urn:uuid:` followed by 0123456789abcdefABCDEF-, found Z at 9 /// | -/// | let id: Uuid = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4"); -/// | ^ +/// | let id = uuid!("F9168C5E-ZEB2-4FAA-B6BF-329BF39FA1E4"); +/// | ^ /// ``` /// /// Tokens that aren't string literals are also rejected: /// /// ```compile_fail -/// # use uuid::{uuid, Uuid}; +/// # use uuid::uuid; /// let uuid_str: &str = "550e8400e29b41d4a716446655440000"; -/// let uuid: Uuid = uuid!(uuid_str); +/// let uuid = uuid!(uuid_str); /// ``` /// /// Provides the following compilation error: @@ -91,8 +91,8 @@ define_uuid_macro! { /// ```txt /// error: expected string literal /// | -/// | let uuid: Uuid = uuid!(uuid_str); -/// | ^^^^^^^^ +/// | let uuid = uuid!(uuid_str); +/// | ^^^^^^^^ /// ``` /// /// [uuid::Uuid]: https://docs.rs/uuid/*/uuid/struct.Uuid.html