Skip to content

Commit

Permalink
Merge pull request #553 from KodrAus/cargo/1.0.0-alpha.1
Browse files Browse the repository at this point in the history
Prepare for 1.0.0-alpha.1 release
  • Loading branch information
KodrAus committed Nov 17, 2021
2 parents 89530db + 4e6412d commit 9bc15f4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 29 deletions.
9 changes: 4 additions & 5 deletions Cargo.toml
Expand Up @@ -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"]
Expand All @@ -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"]
Expand Down Expand Up @@ -98,7 +97,7 @@ optional = true
version = "0.9"

# Public: Re-exported
[dependencies.uuid_macro]
[dependencies.uuid-macro-internal]
path = "macros"
optional = true

Expand Down
9 changes: 7 additions & 2 deletions README.md
Expand Up @@ -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"]
```

Expand Down Expand Up @@ -113,14 +113,19 @@ 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)
* [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace]( http://tools.ietf.org/html/rfc4122)

[`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
Expand Down
15 changes: 13 additions & 2 deletions 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
Expand Down
31 changes: 22 additions & 9 deletions src/lib.rs
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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))]
Expand Down Expand Up @@ -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;

Expand Down
22 changes: 11 additions & 11 deletions src/macros.rs
Expand Up @@ -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))
}};
}

Expand Down Expand Up @@ -54,17 +54,17 @@ 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
///
/// 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.
Expand All @@ -74,25 +74,25 @@ 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:
///
/// ```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
Expand Down

0 comments on commit 9bc15f4

Please sign in to comment.