From 33f6b3edd9ade424ce014dfc808576f657803fa3 Mon Sep 17 00:00:00 2001 From: KodrAus Date: Mon, 17 Jul 2023 08:38:54 +1000 Subject: [PATCH] print uuids in examples --- examples/random_uuid.rs | 6 ++++-- examples/sortable_uuid.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/random_uuid.rs b/examples/random_uuid.rs index 897071c4..ec88c058 100644 --- a/examples/random_uuid.rs +++ b/examples/random_uuid.rs @@ -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() {} diff --git a/examples/sortable_uuid.rs b/examples/sortable_uuid.rs index dc128125..fd4b56f3 100644 --- a/examples/sortable_uuid.rs +++ b/examples/sortable_uuid.rs @@ -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() {}