mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-17 15:17:23 +08:00
clippy all codes (#1214)
1. clippy code 2. add fmt and clippy check in ci
This commit is contained in:
@@ -34,7 +34,7 @@ impl TryFrom<WeakRefStorage> for Storage {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(weak: Weak<StorageInner>) -> Result<Self, Self::Error> {
|
||||
weak.upgrade().map(|inner| Storage(inner)).ok_or(())
|
||||
weak.upgrade().map(Storage).ok_or(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,9 +51,7 @@ impl Storage {
|
||||
machine_id: &uuid::Uuid,
|
||||
client_url: &url::Url,
|
||||
) {
|
||||
map.remove_if(&machine_id, |_, v| {
|
||||
v.storage_token.client_url == *client_url
|
||||
});
|
||||
map.remove_if(machine_id, |_, v| v.storage_token.client_url == *client_url);
|
||||
}
|
||||
|
||||
fn update_mid_to_client_info_map(
|
||||
@@ -74,11 +72,7 @@ impl Storage {
|
||||
}
|
||||
|
||||
pub fn update_client(&self, stoken: StorageToken, report_time: i64) {
|
||||
let inner = self
|
||||
.0
|
||||
.user_clients_map
|
||||
.entry(stoken.user_id)
|
||||
.or_insert_with(DashMap::new);
|
||||
let inner = self.0.user_clients_map.entry(stoken.user_id).or_default();
|
||||
|
||||
let client_info = ClientInfo {
|
||||
storage_token: stoken.clone(),
|
||||
|
||||
Reference in New Issue
Block a user