Skip to content

Commit

Permalink
refactor: rustc beta is stricter again wrt imports and unused code (#…
Browse files Browse the repository at this point in the history
…2185)

## Description

Some more unused code and duplicate imports detected by the beta
compiler.

## Notes & open questions

Are the examples sufficiently tested by CI?

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.
  • Loading branch information
flub authored Apr 15, 2024
1 parent 2cfa055 commit d6f336c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
11 changes: 0 additions & 11 deletions iroh-bytes/examples/fetch-fsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,3 @@ async fn write_collection(initial: AtInitial) -> Result<()> {
let _stats = closing.next().await?;
Ok(())
}

#[derive(Clone)]
struct MockEventSender;

use futures::future::FutureExt;

impl iroh_bytes::provider::EventSender for MockEventSender {
fn send(&self, _event: iroh_bytes::provider::Event) -> futures::future::BoxFuture<()> {
async move {}.boxed()
}
}
11 changes: 0 additions & 11 deletions iroh-bytes/examples/fetch-stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,3 @@ fn stream_children(initial: AtInitial) -> impl Stream<Item = io::Result<Bytes>>
}
})
}

#[derive(Clone)]
struct MockEventSender;

use futures::future::FutureExt;

impl iroh_bytes::provider::EventSender for MockEventSender {
fn send(&self, _event: iroh_bytes::provider::Event) -> futures::future::BoxFuture<()> {
async move {}.boxed()
}
}
5 changes: 1 addition & 4 deletions iroh-net/src/stun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,7 @@ pub fn parse_response(b: &[u8]) -> Result<(TransactionId, SocketAddr), Error> {

#[cfg(any(test, feature = "test-utils"))]
pub(crate) mod test {
use std::{
net::{IpAddr, SocketAddr},
sync::Arc,
};
use std::{net::IpAddr, sync::Arc};

use anyhow::Result;
use tokio::{
Expand Down

0 comments on commit d6f336c

Please sign in to comment.