tokio: raise MSRV to 1.71 (#7658)

This commit is contained in:
Alice Ryhl
2025-10-02 11:14:17 +02:00
committed by GitHub
parent c1f0c76fa0
commit 5b4cbbc39e
11 changed files with 26 additions and 51 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ name = "tokio-stream"
# - Create "tokio-stream-0.1.x" git tag.
version = "0.1.17"
edition = "2021"
rust-version = "1.70"
rust-version = "1.71"
authors = ["Tokio Contributors <[email protected]>"]
license = "MIT"
repository = "https://github.com/tokio-rs/tokio"
+2 -9
View File
@@ -734,22 +734,15 @@ mod rand {
#[cfg(not(loom))]
pub(crate) mod rand {
use std::collections::hash_map::RandomState;
use std::hash::{BuildHasher, Hash, Hasher};
use std::hash::BuildHasher;
use std::sync::atomic::AtomicU32;
use std::sync::atomic::Ordering::Relaxed;
static COUNTER: AtomicU32 = AtomicU32::new(1);
pub(crate) fn seed() -> u64 {
let rand_state = RandomState::new();
let mut hasher = rand_state.build_hasher();
// Hash some unique-ish data to generate some new state
COUNTER.fetch_add(1, Relaxed).hash(&mut hasher);
// Get the seed
hasher.finish()
RandomState::new().hash_one(COUNTER.fetch_add(1, Relaxed))
}
}