Activate lint for dead-code checking

For test code, we need it in a couple of places.

Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
Alexis Sellier 2022-10-18 12:39:11 +02:00
parent 1df5cf0c45
commit ae95b229f5
No known key found for this signature in database
5 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,3 @@
#![allow(dead_code)]
pub mod address; pub mod address;
pub mod client; pub mod client;
pub mod clock; pub mod clock;

View File

@ -41,6 +41,7 @@ impl Log for Logger {
fn flush(&self) {} fn flush(&self) {}
} }
#[allow(dead_code)]
pub fn init(level: Level) { pub fn init(level: Level) {
let logger = Logger { level }; let logger = Logger { level };

View File

@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::iter; use std::iter;
use std::net; use std::net;

View File

@ -1,5 +1,6 @@
//! A simple P2P network simulator. Acts as the _reactor_, but without doing any I/O. //! A simple P2P network simulator. Acts as the _reactor_, but without doing any I/O.
#![allow(clippy::collapsible_if)] #![allow(clippy::collapsible_if)]
#![allow(dead_code)]
#[cfg(feature = "quickcheck")] #[cfg(feature = "quickcheck")]
pub mod arbitrary; pub mod arbitrary;

View File

@ -15,19 +15,19 @@ use crate::wire::Wire;
#[derive(Debug)] #[derive(Debug)]
struct Peer { struct Peer {
addr: net::SocketAddr, _addr: net::SocketAddr,
} }
#[derive(Debug)] #[derive(Debug)]
pub struct Transport<R, S, T, G> { pub struct Transport<R, S, T, G> {
peers: HashMap<net::IpAddr, Peer>, _peers: HashMap<net::IpAddr, Peer>,
inner: Wire<R, S, T, G>, inner: Wire<R, S, T, G>,
} }
impl<R, S, T, G> Transport<R, S, T, G> { impl<R, S, T, G> Transport<R, S, T, G> {
pub fn new(inner: Wire<R, S, T, G>) -> Self { pub fn new(inner: Wire<R, S, T, G>) -> Self {
Self { Self {
peers: HashMap::default(), _peers: HashMap::default(),
inner, inner,
} }
} }