diff --git a/crates/cuid1/src/cuid1.rs b/crates/cuid1/src/cuid1.rs index a7bf9bf..73a2522 100644 --- a/crates/cuid1/src/cuid1.rs +++ b/crates/cuid1/src/cuid1.rs @@ -230,21 +230,21 @@ mod tests { #[test] fn cuid_is_cuid() { - assert!(is_cuid(cuid1().unwrap())); + assert!(is_cuid1(cuid1().unwrap())); } #[test] fn cuid_is_not_cuid_zero_len() { - assert!(!is_cuid("")); + assert!(!is_cuid1("")); } #[test] fn slug_len() { - assert!(slug().unwrap().len() == 10); + assert!(cuid1_slug().unwrap().len() == 10); } #[test] fn slug_is_slug() { - assert!(is_slug(slug().unwrap())); + assert!(is_cuid1_slug(cuid1_slug().unwrap())); } } diff --git a/crates/cuid1/src/lib.rs b/crates/cuid1/src/lib.rs index bd29e8a..f084ab1 100644 --- a/crates/cuid1/src/lib.rs +++ b/crates/cuid1/src/lib.rs @@ -6,7 +6,7 @@ //! use cuid; //! //! // Get a v1 CUID -//! println!("{}", cuid::cuid1()); +//! println!("{}", cuid::cuid1().unwrap()); //! //! // Get a v2 CUID //! println!("{}", cuid::cuid2()); diff --git a/crates/cuid1/tests/cuid1/collisions.rs b/crates/cuid1/tests/cuid1/collisions.rs index 7019f74..3025348 100644 --- a/crates/cuid1/tests/cuid1/collisions.rs +++ b/crates/cuid1/tests/cuid1/collisions.rs @@ -10,7 +10,7 @@ mod test { fn check_cuid_collisions() { let mut set = HashSet::new(); for _ in 0..1_200_000 { - let id = cuid::cuid().unwrap(); + let id = cuid::cuid1().unwrap(); set.insert(id); } // we generated unique CUIDs @@ -31,7 +31,7 @@ mod test { let t = thread::spawn(move || { let mut thread_set = HashSet::new(); for _ in 0..ids_per_thread { - let id = cuid::cuid().unwrap(); + let id = cuid::cuid1().unwrap(); thread_set.insert(id); } let mut sets = thread_sets.lock().unwrap(); @@ -79,7 +79,7 @@ mod single_thread { fn check_slug_collisions() { let mut set = HashSet::new(); for _ in 0..1_200_000 { - let id = cuid::slug().unwrap(); + let id = cuid::cuid1_slug().unwrap(); set.insert(id); } // we had no duplicate slugs diff --git a/crates/cuid1/tests/cuid1/length.rs b/crates/cuid1/tests/cuid1/length.rs index 9d37155..09ae4cd 100644 --- a/crates/cuid1/tests/cuid1/length.rs +++ b/crates/cuid1/tests/cuid1/length.rs @@ -6,7 +6,7 @@ use std::collections::HashSet; fn check_cuid_length() { let mut set = HashSet::new(); for _ in 0..100000 { - let id = cuid::cuid().unwrap(); + let id = cuid::cuid1().unwrap(); set.insert(id); } // all CUIDs are of the same length @@ -19,7 +19,7 @@ fn check_cuid_length() { fn check_cuid_slug_length() { let mut set = HashSet::new(); for _ in 0..100000 { - let id = cuid::slug().unwrap(); + let id = cuid::cuid1_slug().unwrap(); set.insert(id); } // all slugs are of the same length