Skip to content

Commit dc96bbc

Browse files
committed
fixup
1 parent f9f3d89 commit dc96bbc

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iroh-relay/src/quic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub const QUIC_ADDR_DISC_CLOSE_REASON: &[u8] = b"finished";
1616

1717
#[cfg(feature = "server")]
1818
pub(crate) mod server {
19-
use n0_error::{StdResultExt, e};
19+
use n0_error::e;
2020
use quinn::{
2121
ApplicationClose, ConnectionError,
2222
crypto::rustls::{NoInitialCipherSuite, QuicServerConfig},
@@ -360,7 +360,7 @@ impl QuicClient {
360360
mod tests {
361361
use std::net::Ipv4Addr;
362362

363-
use n0_error::{Error, Result, StdResultExt};
363+
use n0_error::{Result, StdResultExt};
364364
use n0_future::{
365365
task::AbortOnDropHandle,
366366
time::{self, Instant},

iroh-relay/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use hyper::body::Incoming;
2626
use iroh_base::EndpointId;
2727
#[cfg(feature = "test-utils")]
2828
use iroh_base::RelayUrl;
29-
use n0_error::{Err, Error, StdResultExt, add_meta, e};
29+
use n0_error::{Error, add_meta, e};
3030
use n0_future::{StreamExt, future::Boxed};
3131
use tokio::{
3232
net::TcpListener,

iroh-relay/src/server/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::{collections::HashSet, sync::Arc, time::Duration};
44

55
use iroh_base::EndpointId;
6-
use n0_error::{Err, Error, StackResultExt, add_meta, e};
6+
use n0_error::{Err, Error, add_meta, e};
77
use n0_future::{SinkExt, StreamExt};
88
use rand::Rng;
99
use time::{Date, OffsetDateTime};
@@ -500,7 +500,7 @@ pub(crate) enum SendError {
500500
#[add_meta]
501501
#[derive(Error)]
502502
#[display("failed to forward {scope:?} packet: {reason:?}")]
503-
pub(crate) struct ForwardPacketError {
503+
pub struct ForwardPacketError {
504504
scope: PacketScope,
505505
reason: SendError,
506506
}
@@ -724,8 +724,8 @@ mod tests {
724724

725725
// Send a frame, it should arrive.
726726
info!("-- send packet");
727-
frame_writer.send(frame.clone()).await.context("send")?;
728-
frame_writer.flush().await.context("flush")?;
727+
frame_writer.send(frame.clone()).await.std_context("send")?;
728+
frame_writer.flush().await.std_context("flush")?;
729729
let recv_frame = tokio::time::timeout(Duration::from_millis(500), stream.next())
730730
.await
731731
.expect("timeout")
@@ -735,8 +735,8 @@ mod tests {
735735

736736
// Next frame does not arrive.
737737
info!("-- send packet");
738-
frame_writer.send(frame.clone()).await.context("send")?;
739-
frame_writer.flush().await.context("flush")?;
738+
frame_writer.send(frame.clone()).await.std_context("send")?;
739+
frame_writer.flush().await.std_context("flush")?;
740740
let res = tokio::time::timeout(Duration::from_millis(100), stream.next()).await;
741741
assert!(res.is_err(), "expecting a timeout");
742742
info!("-- timeout happened");

iroh-relay/src/server/http_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use hyper::{
1515
service::Service,
1616
upgrade::Upgraded,
1717
};
18-
use n0_error::{Err, Error, StackResultExt, StdResultExt, add_meta, e};
18+
use n0_error::{Err, Error, add_meta, e};
1919
use n0_future::time::Elapsed;
2020
use tokio::net::{TcpListener, TcpStream};
2121
use tokio_rustls_acme::AcmeAcceptor;

iroh/examples/screening-connection.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use iroh::{
1717
endpoint::{Connecting, Connection},
1818
protocol::{AcceptError, ProtocolHandler, Router},
1919
};
20-
use n0_error::{Result, StdResultExt};
20+
use n0_error::{Err, Result, StdResultExt};
2121

2222
/// Each protocol is identified by its ALPN string.
2323
///
@@ -110,9 +110,7 @@ impl ProtocolHandler for ScreenedEcho {
110110
// reject every other connection
111111
if count % 2 == 0 {
112112
println!("rejecting connection");
113-
return Err(AcceptError::NotAllowed {
114-
meta: n0_error::Meta::new(),
115-
});
113+
return Err!(AcceptError::NotAllowed);
116114
}
117115

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

0 commit comments

Comments
 (0)