Skip to content

Commit

Permalink
no &mut
Browse files Browse the repository at this point in the history
  • Loading branch information
kinosang committed Nov 23, 2023
1 parent c871210 commit fc98889
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fastid"
version = "0.3.2"
version = "0.3.3"
authors = ["Chino Chang <[email protected]>"]
edition = "2021"

Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl FastIdWorker {
}
}

fn get_current_timestamp(&mut self) -> u64 {
fn get_current_timestamp(&self) -> u64 {
let duration = SystemTime::now()
.duration_since(self.epoch)
.unwrap_or(Duration::new(0, 0));
Expand All @@ -144,7 +144,7 @@ impl FastIdWorker {
timestamp as u64
}

pub fn next_id(&mut self) -> FastId {
pub fn next_id(&self) -> FastId {
loop {
let ts = self.get_current_timestamp();

Expand Down

0 comments on commit fc98889

Please sign in to comment.