Bump to Rust 2024

This commit is contained in:
mdecimus
2025-02-21 09:59:23 +01:00
parent b1d6e71715
commit 44f8ef29e1
92 changed files with 570 additions and 477 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "utils"
version = "0.11.5"
edition = "2021"
edition = "2024"
resolver = "2"
[dependencies]
@@ -17,7 +17,7 @@ smtp-proto = { version = "0.1" }
mail-send = { version = "0.5", default-features = false, features = ["cram-md5", "ring", "tls12"] }
ahash = { version = "0.8" }
chrono = "0.4"
rand = "0.8.5"
rand = "0.9.0"
webpki-roots = { version = "0.26"}
ring = { version = "0.17" }
base64 = "0.22"

View File

@@ -1,7 +1,7 @@
[package]
name = "proc_macros"
version = "0.11.5"
edition = "2021"
edition = "2024"
[lib]
proc-macro = true

View File

@@ -75,8 +75,8 @@ impl SnowflakeIdGenerator {
let elapsed = self.epoch.elapsed().ok()?.as_millis() as u64;
let sequence = self.sequence.fetch_add(1, Ordering::Relaxed);
(elapsed << (SEQUENCE_LEN + NODE_ID_LEN)
| (self.node_id & NODE_ID_MASK) << SEQUENCE_LEN
((elapsed << (SEQUENCE_LEN + NODE_ID_LEN))
| ((self.node_id & NODE_ID_MASK) << SEQUENCE_LEN)
| (sequence & SEQUENCE_MASK))
.into()
}