diff --git a/src/lib.rs b/src/lib.rs index c35c86f..634a5ca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -171,15 +171,8 @@ fn new_unique_id(mut ids: Vec) -> String { let mut new_id: u64 = 0; - for id in ids { - let id= from_base36(&id); - if id.is_ok() { - if new_id != id.unwrap() { - break; - } - - new_id += 1; - } + while ids.contains(&new_id.to_base36()) { + new_id += 1; } return to_base36(new_id);