mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
chore: update Rust to 2024 edition (#2066)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user