lints
This commit is contained in:
parent
45489d0e9c
commit
ea8c75a29f
2
external/if-addrs
vendored
2
external/if-addrs
vendored
@ -1 +1 @@
|
||||
Subproject commit bf082064c312f5eba998cca90a02c185998dce9d
|
||||
Subproject commit d16e76ce1f6edb03300e3f9ee264fcd611799fdb
|
2
external/keyring-rs
vendored
2
external/keyring-rs
vendored
@ -1 +1 @@
|
||||
Subproject commit 6562019f0b86f622ab5dcadede80f7c8c8ea1eea
|
||||
Subproject commit 70616ea279ae560d0f91d23ad707c713320e3d7b
|
2
external/keyvaluedb
vendored
2
external/keyvaluedb
vendored
@ -1 +1 @@
|
||||
Subproject commit a0ade9c9c9eafb54f240106a36edc74f34c2ebfd
|
||||
Subproject commit 4971ce612e7aace83b17022132687f6f380dbbae
|
@ -127,9 +127,9 @@ impl AttachmentManager {
|
||||
crypto: crypto.clone(),
|
||||
attachment_machine: CallbackStateMachine::new(),
|
||||
network_manager: NetworkManager::new(
|
||||
config.clone(),
|
||||
table_store.clone(),
|
||||
crypto.clone(),
|
||||
config,
|
||||
table_store,
|
||||
crypto,
|
||||
),
|
||||
maintain_peers: false,
|
||||
peer_count: 0,
|
||||
|
@ -111,7 +111,7 @@ impl ConnectionTable {
|
||||
|
||||
let res = inner.conn_by_addr.remove(descriptor);
|
||||
match res {
|
||||
Some(v) => Ok(v.clone()),
|
||||
Some(v) => Ok(v),
|
||||
None => Err(()),
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ pub async fn save_user_secret_string(
|
||||
let existed = kr.get_password().is_ok();
|
||||
let _ = kr
|
||||
.set_password(value)
|
||||
.map_err(|e| format!("Failed to save user secret: {}", e).to_owned())?;
|
||||
.map_err(|e| format!("Failed to save user secret: {}", e))?;
|
||||
Ok(existed)
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ pub async fn load_user_secret_string(namespace: &str, key: &str) -> Result<Optio
|
||||
match kr.get_password() {
|
||||
Ok(v) => Ok(Some(v)),
|
||||
Err(KeyringError::NoPasswordFound) => Ok(None),
|
||||
Err(e) => Err(format!("Failed to load user secret: {}", e).to_owned()),
|
||||
Err(e) => Err(format!("Failed to load user secret: {}", e)),
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,6 +53,6 @@ pub async fn remove_user_secret_string(namespace: &str, key: &str) -> Result<boo
|
||||
match kr.delete_password() {
|
||||
Ok(_) => Ok(true),
|
||||
Err(KeyringError::NoPasswordFound) => Ok(false),
|
||||
Err(e) => Err(format!("Failed to remove user secret: {}", e).to_owned()),
|
||||
Err(e) => Err(format!("Failed to remove user secret: {}", e)),
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ impl TableDB {
|
||||
Self {
|
||||
inner: Arc::new(Mutex::new(TableDBInner {
|
||||
table,
|
||||
table_store: table_store.clone(),
|
||||
table_store,
|
||||
database,
|
||||
})),
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ impl LeaseManager {
|
||||
self.inner.lock().client_relay_mode
|
||||
}
|
||||
|
||||
pub fn client_is_relay_peer_addr(&self, peer_addr: PeerAddress) -> bool {
|
||||
pub fn client_is_relay_peer_addr(&self, _peer_addr: PeerAddress) -> bool {
|
||||
error!("unimplemented");
|
||||
false
|
||||
}
|
||||
@ -101,7 +101,7 @@ impl LeaseManager {
|
||||
// Server-side
|
||||
|
||||
// Signal leases
|
||||
pub fn server_has_valid_signal_lease(&self, recipient_id: &DHTKey) -> bool {
|
||||
pub fn server_has_valid_signal_lease(&self, _recipient_id: &DHTKey) -> bool {
|
||||
error!("unimplemented");
|
||||
false
|
||||
}
|
||||
@ -143,7 +143,7 @@ impl LeaseManager {
|
||||
}
|
||||
|
||||
// Relay leases
|
||||
pub fn server_has_valid_relay_lease(&self, recipient_id: &DHTKey) -> bool {
|
||||
pub fn server_has_valid_relay_lease(&self, _recipient_id: &DHTKey) -> bool {
|
||||
error!("unimplemented");
|
||||
false
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ impl NetworkManager {
|
||||
|
||||
pub fn new(config: VeilidConfig, table_store: TableStore, crypto: Crypto) -> Self {
|
||||
Self {
|
||||
config: config.clone(),
|
||||
config,
|
||||
table_store,
|
||||
crypto,
|
||||
inner: Arc::new(Mutex::new(Self::new_inner())),
|
||||
@ -269,7 +269,7 @@ impl NetworkManager {
|
||||
.lock()
|
||||
.connection_add_channel_tx
|
||||
.as_ref()
|
||||
.ok_or("connection channel isn't open yet".to_owned())?
|
||||
.ok_or_else(|| "connection channel isn't open yet".to_owned())?
|
||||
.clone();
|
||||
let this = self.clone();
|
||||
let receiver_loop_future = Self::process_connection(this, descriptor, conn);
|
||||
|
@ -321,7 +321,7 @@ impl ReceiptManager {
|
||||
let mut inner = self.inner.lock();
|
||||
inner
|
||||
.receipts_by_nonce
|
||||
.insert(receipt.get_nonce(), record.clone());
|
||||
.insert(receipt.get_nonce(), record);
|
||||
}
|
||||
|
||||
pub fn record_single_shot_receipt(
|
||||
@ -336,7 +336,7 @@ impl ReceiptManager {
|
||||
let mut inner = self.inner.lock();
|
||||
inner
|
||||
.receipts_by_nonce
|
||||
.insert(receipt.get_nonce(), record.clone());
|
||||
.insert(receipt.get_nonce(), record);
|
||||
}
|
||||
|
||||
fn update_next_oldest_timestamp(inner: &mut ReceiptManagerInner) {
|
||||
|
@ -208,7 +208,7 @@ impl RoutingTable {
|
||||
"Local Dial Info: {} ({:?})",
|
||||
NodeDialInfoSingle {
|
||||
node_id: NodeId::new(inner.node_id),
|
||||
dial_info: dial_info.clone()
|
||||
dial_info
|
||||
}
|
||||
.to_string(),
|
||||
origin,
|
||||
@ -284,7 +284,7 @@ impl RoutingTable {
|
||||
"Public Dial Info: {} ({:?}#{:?})",
|
||||
NodeDialInfoSingle {
|
||||
node_id: NodeId::new(inner.node_id),
|
||||
dial_info: dial_info.clone()
|
||||
dial_info
|
||||
}
|
||||
.to_string(),
|
||||
origin,
|
||||
|
@ -81,21 +81,21 @@ pub async fn test_add_get_remove() {
|
||||
assert_eq!(table.get_connection(&a1), Some(entry1.clone()));
|
||||
assert_eq!(table.get_connection(&a1), Some(entry1.clone()));
|
||||
assert_eq!(table.connection_count(), 1);
|
||||
assert_eq!(table.remove_connection(&a2), Ok(entry1.clone()));
|
||||
assert_eq!(table.remove_connection(&a2), Ok(entry1));
|
||||
assert_eq!(table.connection_count(), 0);
|
||||
assert_eq!(table.remove_connection(&a2), Err(()));
|
||||
assert_eq!(table.connection_count(), 0);
|
||||
assert_eq!(table.get_connection(&a2), None);
|
||||
assert_eq!(table.get_connection(&a1), None);
|
||||
assert_eq!(table.connection_count(), 0);
|
||||
let entry2 = table.add_connection(a1.clone(), c1.clone()).unwrap();
|
||||
let entry2 = table.add_connection(a1, c1.clone()).unwrap();
|
||||
assert_eq!(table.add_connection(a2.clone(), c1), Err(()));
|
||||
let entry3 = table.add_connection(a3.clone(), c2.clone()).unwrap();
|
||||
let entry4 = table.add_connection(a4.clone(), c3.clone()).unwrap();
|
||||
let entry3 = table.add_connection(a3.clone(), c2).unwrap();
|
||||
let entry4 = table.add_connection(a4.clone(), c3).unwrap();
|
||||
assert_eq!(table.connection_count(), 3);
|
||||
assert_eq!(table.remove_connection(&a2), Ok(entry2.clone()));
|
||||
assert_eq!(table.remove_connection(&a3), Ok(entry3.clone()));
|
||||
assert_eq!(table.remove_connection(&a4), Ok(entry4.clone()));
|
||||
assert_eq!(table.remove_connection(&a2), Ok(entry2));
|
||||
assert_eq!(table.remove_connection(&a3), Ok(entry3));
|
||||
assert_eq!(table.remove_connection(&a4), Ok(entry4));
|
||||
assert_eq!(table.connection_count(), 0);
|
||||
}
|
||||
|
||||
|
@ -111,8 +111,8 @@ pub async fn test_eventual_value() {
|
||||
e1_c1.resolve(3u32);
|
||||
});
|
||||
|
||||
assert_eq!(i1.await, ());
|
||||
assert_eq!(i4.await, ());
|
||||
i1.await;
|
||||
i4.await;
|
||||
jh.await;
|
||||
assert_eq!(e1.take_value(), Some(3u32));
|
||||
}
|
||||
@ -126,15 +126,15 @@ pub async fn test_eventual_value() {
|
||||
let jh = intf::spawn(async move {
|
||||
let i5 = e1.instance();
|
||||
let i6 = e1.instance();
|
||||
assert_eq!(i1.await, ());
|
||||
assert_eq!(i5.await, ());
|
||||
assert_eq!(i6.await, ());
|
||||
i1.await;
|
||||
i5.await;
|
||||
i6.await;
|
||||
});
|
||||
intf::sleep(1000).await;
|
||||
let resolved = e1_c1.resolve(4u16);
|
||||
drop(i2);
|
||||
drop(i3);
|
||||
assert_eq!(i4.await, ());
|
||||
i4.await;
|
||||
resolved.await;
|
||||
jh.await;
|
||||
assert_eq!(e1_c1.take_value(), Some(4u16));
|
||||
@ -146,8 +146,8 @@ pub async fn test_eventual_value() {
|
||||
let i2 = e1.instance();
|
||||
let e1_c1 = e1.clone();
|
||||
let jh = intf::spawn(async move {
|
||||
assert_eq!(i1.await, ());
|
||||
assert_eq!(i2.await, ());
|
||||
i1.await;
|
||||
i2.await;
|
||||
});
|
||||
intf::sleep(1000).await;
|
||||
e1_c1.resolve(5u32).await;
|
||||
@ -159,8 +159,8 @@ pub async fn test_eventual_value() {
|
||||
let j1 = e1.instance();
|
||||
let j2 = e1.instance();
|
||||
let jh = intf::spawn(async move {
|
||||
assert_eq!(j1.await, ());
|
||||
assert_eq!(j2.await, ());
|
||||
j1.await;
|
||||
j2.await;
|
||||
});
|
||||
intf::sleep(1000).await;
|
||||
e1_c1.resolve(6u32).await;
|
||||
|
Loading…
Reference in New Issue
Block a user