Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rklaehn committed Jul 16, 2024
1 parent 856315d commit e80e82f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
22 changes: 9 additions & 13 deletions iroh-blobs/src/util/local_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ pub struct Config {
impl Default for Config {
fn default() -> Self {
Self {
threads: num_cpus::get()
.try_into()
.expect("invalid number of threads"),
threads: num_cpus::get(),
queue_size: 1024,
thread_name_prefix: "local-pool-",
}
Expand Down Expand Up @@ -274,16 +272,14 @@ mod tests {
}

/// Create a non-send test future that captures a TestDrop instance
fn non_send(x: TestDrop) -> impl Future<Output = ()> {
async move {
// just to make sure the future is not Send
let t = Rc::new(RefCell::new(0));
tokio::time::sleep(Duration::from_millis(100)).await;
drop(t);
// drop x at the end. we will never get here when the future is
// no longer polled, but drop should still be called
drop(x);
}
async fn non_send(x: TestDrop) {
// just to make sure the future is not Send
let t = Rc::new(RefCell::new(0));
tokio::time::sleep(Duration::from_millis(100)).await;
drop(t);
// drop x at the end. we will never get here when the future is
// no longer polled, but drop should still be called
drop(x);
}

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion iroh/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl<D: BaoStore> Node<D> {

/// Returns a reference to the used `LocalPoolHandle`.
pub fn local_pool_handle(&self) -> &LocalPoolHandle {
&self.inner.rt.handle()
self.inner.rt.handle()
}

/// Get the relay server we are connected to.
Expand Down

0 comments on commit e80e82f

Please sign in to comment.