Skip to content

Commit

Permalink
Amend team id to random i64; not uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeleke committed Dec 18, 2024
1 parent b4f33e3 commit 9aa2b12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
12 changes: 1 addition & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ dioxus-logger = "0.6.0"
dioxus-web = "0.6.0"
getrandom = { version = "0.2.15", features = ["js"] }
gloo-storage = "0.3.0"
rand = "0.8.5"
serde = { version = "1.0.215", features = ["derive"] }
thiserror = "2.0.4"
uuid = { version = "1.10.0", features = ["v4", "serde"] }

[profile]

Expand Down
7 changes: 4 additions & 3 deletions src/domain/team_id.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use derive_more::*;
use rand::Rng;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Clone, Copy, Debug, Display, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct TeamId(Uuid);
pub struct TeamId(i64);

impl TeamId {
pub fn new() -> Self {
TeamId(Uuid::new_v4())
let mut rng = rand::thread_rng();
TeamId(rng.gen::<i64>())
}
}

0 comments on commit 9aa2b12

Please sign in to comment.