chore: update Rust to 2024 edition (#2066)

This commit is contained in:
Luna Yao
2026-04-09 18:22:12 +02:00
committed by GitHub
parent a8feb9ac2b
commit a879dd1b14
158 changed files with 1327 additions and 1231 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
use std::{
sync::{
atomic::{AtomicBool, AtomicU32, Ordering},
Arc, Mutex, RwLock,
atomic::{AtomicBool, AtomicU32, Ordering},
},
time::{SystemTime, UNIX_EPOCH},
};
@@ -10,7 +10,7 @@ use atomic_shim::AtomicU64;
use crate::{
common::PeerId,
peers::encrypt::{create_encryptor, Encryptor},
peers::encrypt::{Encryptor, create_encryptor},
tunnel::packet_def::{StandardAeadTail, ZCPacket},
};
use anyhow::anyhow;
@@ -189,11 +189,11 @@ impl PeerSessionStore {
PeerSessionAction::Sync | PeerSessionAction::Create => {
let root_key = root_key_32.ok_or_else(|| anyhow!("missing root_key"))?;
// If the existing session is invalidated, remove it so we create a fresh one
if let Some(existing) = self.sessions.get(key) {
if !existing.is_valid() {
drop(existing);
self.sessions.remove(key);
}
if let Some(existing) = self.sessions.get(key)
&& !existing.is_valid()
{
drop(existing);
self.sessions.remove(key);
}
let session = self
.sessions