Skip to content

Commit

Permalink
print uuids in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jul 16, 2023
1 parent 952f75f commit 33f6b3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions examples/random_uuid.rs
Expand Up @@ -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() {}
6 changes: 4 additions & 2 deletions examples/sortable_uuid.rs
Expand Up @@ -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() {}

0 comments on commit 33f6b3e

Please sign in to comment.