Skip to content

Commit 8afe0b7

Browse files
committed
chore: clippy fix & cargo fix & fmt
1 parent 47064a3 commit 8afe0b7

File tree

9 files changed

+19
-17
lines changed

9 files changed

+19
-17
lines changed

iroh-dns-server/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{
77
time::Duration,
88
};
99

10-
use n0_error::{Result, StackResultExt, StdResultExt};
10+
use n0_error::{Result, StdResultExt};
1111
use serde::{Deserialize, Serialize};
1212
use tracing::info;
1313

iroh-dns-server/src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use axum::{
1414
response::IntoResponse,
1515
routing::get,
1616
};
17-
use n0_error::{Result, StackResultExt, StdResultExt, whatever};
17+
use n0_error::{Result, StdResultExt, whatever};
1818
use serde::{Deserialize, Serialize};
1919
use tokio::{net::TcpListener, task::JoinSet};
2020
use tower_http::{

iroh-dns-server/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ mod tests {
4343
#[tokio::test]
4444
#[traced_test]
4545
async fn pkarr_publish_dns_resolve() -> Result {
46-
let (server, nameserver, http_url) = Server::spawn_for_tests().await.e()?;
46+
let (server, nameserver, http_url) = Server::spawn_for_tests().await?;
4747
let pkarr_relay_url = {
4848
let mut url = http_url.clone();
4949
url.set_path("/pkarr");
@@ -158,7 +158,7 @@ mod tests {
158158
#[tokio::test]
159159
#[traced_test]
160160
async fn integration_smoke() -> Result {
161-
let (server, nameserver, http_url) = Server::spawn_for_tests().await.e()?;
161+
let (server, nameserver, http_url) = Server::spawn_for_tests().await?;
162162

163163
let pkarr_relay = {
164164
let mut url = http_url.clone();
@@ -213,7 +213,7 @@ mod tests {
213213

214214
tokio::time::sleep(Duration::from_secs(1)).await;
215215
for _ in 0..10 {
216-
let entry = store.get_signed_packet(&key).await.e()?;
216+
let entry = store.get_signed_packet(&key).await?;
217217
if entry.is_none() {
218218
return Ok(());
219219
}
@@ -264,7 +264,7 @@ mod tests {
264264
assert_eq!(res.endpoint_id, endpoint_id);
265265
assert_eq!(res.relay_url(), Some(&relay_url));
266266

267-
server.shutdown().await.e()?;
267+
server.shutdown().await?;
268268
Ok(())
269269
}
270270

iroh/examples/0rtt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async fn accept(_args: Args) -> Result<()> {
166166
send.write_all(&data).await.e()?;
167167
send.finish().e()?;
168168
connection.closed().await;
169-
Ok::<_, n0_error::Error>(())
169+
Ok::<_, n0_error::AnyError>(())
170170
});
171171
}
172172
};

iroh/examples/dht_discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async fn chat_server(args: Args) -> Result<()> {
100100
tokio::spawn(
101101
async move { tokio::io::copy(&mut tokio::io::stdin(), &mut writer).await },
102102
);
103-
Ok::<_, n0_error::Error>(())
103+
Ok::<_, n0_error::AnyError>(())
104104
});
105105
}
106106
Ok(())

iroh/examples/listen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async fn main() -> Result<()> {
105105
if res.is_err() {
106106
println!("endpoint {endpoint_id} did not disconnect within 3 seconds");
107107
}
108-
Ok::<_, n0_error::Error>(())
108+
Ok::<_, n0_error::AnyError>(())
109109
});
110110
}
111111
// stop with SIGINT (ctrl-c)

iroh/examples/locally-discovered-nodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async fn main() -> Result<()> {
7373
ep.set_user_data_for_discovery(Some(ud));
7474
tokio::time::sleep(Duration::from_secs(3)).await;
7575
ep.close().await;
76-
Ok::<_, n0_error::Error>(())
76+
Ok::<_, n0_error::AnyError>(())
7777
});
7878
}
7979

iroh/examples/screening-connection.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ impl ProtocolHandler for ScreenedEcho {
110110
// reject every other connection
111111
if count % 2 == 0 {
112112
println!("rejecting connection");
113-
return Err(AcceptError::NotAllowed {});
113+
return Err(AcceptError::NotAllowed {
114+
meta: n0_error::Meta::new(),
115+
});
114116
}
115117

116118
// To allow normal connection construction, await the connecting future & return

iroh/examples/transfer.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl EndpointArgs {
246246
if let Some(host) = self.dns_server {
247247
let addr = tokio::net::lookup_host(host)
248248
.await
249-
.context("Failed to resolve DNS server address")?
249+
.std_context("Failed to resolve DNS server address")?
250250
.next()
251251
.context("Failed to resolve DNS server address")?;
252252
builder = builder.dns_resolver(DnsResolver::with_nameserver(addr));
@@ -379,7 +379,7 @@ async fn provide(endpoint: Endpoint, size: u64) -> Result<()> {
379379
} else {
380380
println!("[{remote}] Disconnected");
381381
}
382-
Ok::<_, n0_error::Error>(())
382+
Ok::<_, n0_error::AnyError>(())
383383
});
384384
}
385385

@@ -493,21 +493,21 @@ async fn send_data_on_stream(
493493
stream
494494
.write_chunk(bytes_data.clone())
495495
.await
496-
.context("failed sending data")?;
496+
.std_context("failed sending data")?;
497497
}
498498

499499
if remaining != 0 {
500500
stream
501501
.write_chunk(bytes_data.slice(0..remaining))
502502
.await
503-
.context("failed sending data")?;
503+
.std_context("failed sending data")?;
504504
}
505505

506-
stream.finish().context("failed finishing stream")?;
506+
stream.finish().std_context("failed finishing stream")?;
507507
stream
508508
.stopped()
509509
.await
510-
.context("failed to wait for stream to be stopped")?;
510+
.std_context("failed to wait for stream to be stopped")?;
511511

512512
Ok(())
513513
}

0 commit comments

Comments
 (0)