Skip to content

Commit d6ff0cf

Browse files
refactor: happy clippy (#2220)
new beta clippy has more to fix :)
1 parent 93290e3 commit d6ff0cf

File tree

7 files changed

+6
-21
lines changed

7 files changed

+6
-21
lines changed

iroh-bytes/src/downloader/invariants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<G: Getter<Connection = D::Connection>, D: Dialer, S: Store> Service<G, D, S
111111
"all queued requests have providers"
112112
);
113113
assert!(
114-
self.requests.get(entry).is_some(),
114+
self.requests.contains_key(entry),
115115
"all queued requests have request info"
116116
);
117117
}

iroh-bytes/src/util/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ use iroh_io::AsyncSliceWriter;
8585
///
8686
/// A typical implementation will wrap the sender part of a channel and an id generator.
8787
pub trait ProgressSender: std::fmt::Debug + Clone + Send + Sync + 'static {
88-
///
88+
/// The message being sent.
8989
type Msg: Send + Sync + 'static;
9090

9191
/// Send a message and wait if the receiver is full.

iroh-net/src/netcheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ impl Actor {
630630
fn add_report_history_and_set_preferred_relay(&mut self, mut r: Report) -> Arc<Report> {
631631
let mut prev_relay = None;
632632
if let Some(ref last) = self.reports.last {
633-
prev_relay = last.preferred_relay.clone();
633+
prev_relay.clone_from(&last.preferred_relay);
634634
}
635635
let now = Instant::now();
636636
const MAX_AGE: Duration = Duration::from_secs(5 * 60);

iroh-net/src/relay/clients.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ mod tests {
329329

330330
clients.unregister(&a_key.clone());
331331

332-
assert!(clients.inner.get(&a_key).is_none());
332+
assert!(!clients.inner.contains_key(&a_key));
333333

334334
clients.shutdown().await;
335335
Ok(())

iroh-sync/src/store/fs/tables.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::time::Instant;
66
use bytes::Bytes;
77
use redb::{
88
MultimapTable, MultimapTableDefinition, ReadOnlyMultimapTable, ReadOnlyTable, ReadTransaction,
9-
ReadableTable, Table, TableDefinition, WriteTransaction,
9+
Table, TableDefinition, WriteTransaction,
1010
};
1111

1212
use crate::PeerIdBytes;
@@ -73,20 +73,6 @@ pub type Nanos = u64;
7373
pub const DOWNLOAD_POLICY_TABLE: TableDefinition<&[u8; 32], &[u8]> =
7474
TableDefinition::new("download-policy-1");
7575

76-
pub trait ReadableTables {
77-
fn records(&self) -> impl ReadableTable<RecordsId<'static>, RecordsValue<'static>>;
78-
fn records_by_key(&self) -> impl ReadableTable<RecordsByKeyId<'static>, ()>;
79-
fn namespaces(&self) -> impl ReadableTable<&'static [u8; 32], (u8, &'static [u8; 32])>;
80-
fn latest_per_author(
81-
&self,
82-
) -> impl ReadableTable<LatestPerAuthorKey<'static>, LatestPerAuthorValue<'static>>;
83-
// fn namespace_peers(
84-
// &self,
85-
// ) -> impl ReadableMultimapTable<&'static [u8; 32], (Nanos, &'static PeerIdBytes)>;
86-
fn download_policy(&self) -> impl ReadableTable<&'static [u8; 32], &'static [u8]>;
87-
fn authors(&self) -> impl ReadableTable<&'static [u8; 32], &'static [u8; 32]>;
88-
}
89-
9076
self_cell::self_cell! {
9177
struct TransactionAndTablesInner {
9278
owner: WriteTransaction,

iroh/src/node/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use crate::{
4242

4343
use super::{rpc, Callbacks, EventCallback, Node, RpcStatus};
4444

45-
pub const PROTOCOLS: [&[u8]; 3] = [&iroh_bytes::protocol::ALPN, GOSSIP_ALPN, SYNC_ALPN];
45+
pub const PROTOCOLS: [&[u8]; 3] = [iroh_bytes::protocol::ALPN, GOSSIP_ALPN, SYNC_ALPN];
4646

4747
/// Default bind address for the node.
4848
/// 11204 is "iroh" in leetspeak <https://simple.wikipedia.org/wiki/Leet>

iroh/tests/gc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ mod file {
480480
Ok(())
481481
}
482482

483-
///
484483
#[tokio::test]
485484
async fn gc_file_stress() -> Result<()> {
486485
let _ = tracing_subscriber::fmt::try_init();

0 commit comments

Comments
 (0)