mirror of
https://github.com/uuid-rs/uuid.git
synced 2025-09-29 22:10:50 +00:00
print uuids in examples
This commit is contained in:
parent
952f75fb1a
commit
33f6b3edd9
@ -2,14 +2,16 @@
|
||||
//!
|
||||
//! If you enable the `v4` feature you can generate random UUIDs.
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "v4")]
|
||||
fn generate_random_uuid() {
|
||||
fn main() {
|
||||
use uuid::Uuid;
|
||||
|
||||
let uuid = Uuid::new_v4();
|
||||
|
||||
assert_eq!(Some(uuid::Version::Random), uuid.get_version());
|
||||
|
||||
println!("{}", uuid);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "v4"))]
|
||||
fn main() {}
|
||||
|
@ -2,14 +2,16 @@
|
||||
//!
|
||||
//! If you enable the `v7` feature you can generate sortable UUIDs.
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "v7")]
|
||||
fn generate_sortable_uuid() {
|
||||
fn main() {
|
||||
use uuid::Uuid;
|
||||
|
||||
let uuid = Uuid::now_v7();
|
||||
|
||||
assert_eq!(Some(uuid::Version::SortRand), uuid.get_version());
|
||||
|
||||
println!("{}", uuid);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "v7"))]
|
||||
fn main() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user