mirror of
https://github.com/uuid-rs/uuid.git
synced 2025-10-02 15:24:57 +00:00
16 lines
294 B
Rust
16 lines
294 B
Rust
//! Generating a random UUID.
|
|
//!
|
|
//! If you enable the `v4` feature you can generate random UUIDs.
|
|
|
|
#[test]
|
|
#[cfg(feature = "v4")]
|
|
fn generate_random_uuid() {
|
|
use uuid::Uuid;
|
|
|
|
let uuid = Uuid::new_v4();
|
|
|
|
assert_eq!(Some(uuid::Version::Random), uuid.get_version());
|
|
}
|
|
|
|
fn main() {}
|