diff --git a/.github/workflows/general.yml b/.github/workflows/general.yml index 326b8d8..b3cd603 100644 --- a/.github/workflows/general.yml +++ b/.github/workflows/general.yml @@ -82,9 +82,6 @@ jobs: test_uuid_v7: name: Test runs-on: ubuntu-latest - env: - RUSTFLAGS: "--cfg uuid_unstable" - RUSTDOCFLAGS: "--cfg uuid_unstable" steps: - uses: actions/checkout@v2 - name: Cache dependencies diff --git a/README.md b/README.md index bbf30c6..ffb9eed 100644 --- a/README.md +++ b/README.md @@ -290,8 +290,6 @@ If you need to **trace** a request across multiple services (e.g. in a microserv Optionally, using the `uuid_v7` feature flag will allow [`RequestId`] to use UUID v7 instead of the currently used UUID v4. -However, the [`uuid`] crate requires a compile time flag `uuid_unstable` to be passed in `RUSTFLAGS="--cfg uuid_unstable"` in order to compile. You can read more about it [here](https://docs.rs/uuid/latest/uuid/#unstable-features). - ## Trace Id To fulfill a request you often have to perform additional I/O operations - e.g. calls to other REST or gRPC APIs, database queries, etc. diff --git a/src/lib.rs b/src/lib.rs index 88efdb2..7fa9863 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -259,8 +259,6 @@ //! //! Optionally, using the `uuid_v7` feature flag will allow [`RequestId`] to use UUID v7 instead of the currently used UUID v4. //! -//! However, the [`uuid`] crate requires a compile time flag `uuid_unstable` to be passed in `RUSTFLAGS="--cfg uuid_unstable"` in order to compile. You can read more about it [here](https://docs.rs/uuid/latest/uuid/#unstable-features). -//! //! ## Trace Id //! //! To fulfill a request you often have to perform additional I/O operations - e.g. calls to other REST or gRPC APIs, database queries, etc. diff --git a/src/request_id.rs b/src/request_id.rs index dc67504..f59a3c2 100644 --- a/src/request_id.rs +++ b/src/request_id.rs @@ -27,23 +27,16 @@ use uuid::Uuid; /// ``` /// /// Optionally, using the `uuid_v7` feature flag will allow [`RequestId`] to use UUID v7 instead of the currently used UUID v4. -/// -/// However, the [`uuid`] crate requires a compile time flag `uuid_unstable` to be passed in `RUSTFLAGS="--cfg uuid_unstable"` in order to compile. You can read more about it [here](https://docs.rs/uuid/latest/uuid/#unstable-features). -/// #[derive(Clone, Copy, Debug)] pub struct RequestId(Uuid); impl RequestId { pub(crate) fn generate() -> Self { - // Compiler error for providing context on requirements to enable the `uuid_v7` feature flag - #[cfg(all(feature = "uuid_v7", not(uuid_unstable)))] - compile_error!("feature \"uuid_v7\" requires \"uuid_unstable\" to be passed as configuration in rustflags"); - #[cfg(not(feature = "uuid_v7"))] { Self(Uuid::new_v4()) } - #[cfg(all(uuid_unstable, feature = "uuid_v7"))] + #[cfg(feature = "uuid_v7")] { Self(Uuid::now_v7()) }