Skip to content

Commit a33d966

Browse files
committed
clippy
1 parent 58f5c77 commit a33d966

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/api/downloader.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@ use std::{
44
fmt::Debug,
55
future::{Future, IntoFuture},
66
io,
7-
ops::Deref,
87
sync::Arc,
9-
time::{Duration, SystemTime},
108
};
119

1210
use anyhow::bail;
1311
use genawaiter::sync::Gen;
14-
use iroh::{endpoint::Connection, Endpoint, NodeId};
12+
use iroh::{Endpoint, NodeId};
1513
use irpc::{channel::mpsc, rpc_requests};
1614
use n0_future::{future, stream, BufferedStreamExt, Stream, StreamExt};
1715
use rand::seq::SliceRandom;
1816
use serde::{de::Error, Deserialize, Serialize};
19-
use tokio::{sync::Mutex, task::JoinSet};
20-
use tokio_util::time::FutureExt;
21-
use tracing::{info, instrument::Instrument, warn};
17+
use tokio::task::JoinSet;
18+
use tracing::instrument::Instrument;
2219

23-
use super::{remote::GetConnection, Store};
20+
use super::Store;
2421
use crate::{
2522
protocol::{GetManyRequest, GetRequest},
2623
util::{
@@ -445,7 +442,7 @@ async fn execute_get(
445442
request: request.clone(),
446443
})
447444
.await?;
448-
let mut conn = pool.connect(provider);
445+
let conn = pool.connect(provider);
449446
let local = remote.local_for_request(request.clone()).await?;
450447
if local.is_complete() {
451448
return Ok(());

src/api/remote.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ impl Remote {
662662
) -> GetResult<Stats> {
663663
let store = self.store();
664664
let root = request.hash;
665+
// I am cloning the connection, but it's fine because the original connection or ConnectionRef stays alive
666+
// for the duration of the operation.
665667
let start = crate::get::fsm::start(conn.clone(), request, Default::default());
666668
let connected = start.next().await?;
667669
trace!("Getting header");

src/util/connection_pool.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::{
1919
};
2020

2121
use iroh::{
22-
endpoint::{ConnectError, Connection},
22+
endpoint::ConnectError,
2323
Endpoint, NodeId,
2424
};
2525
use n0_future::{
@@ -111,8 +111,6 @@ pub enum ConnectionPoolError {
111111
Shutdown,
112112
}
113113

114-
pub type PoolConnectResult = std::result::Result<Connection, PoolConnectError>;
115-
116114
enum ActorMessage {
117115
RequestRef(RequestRef),
118116
ConnectionIdle { id: NodeId },

0 commit comments

Comments
 (0)