Merge pull request #158 from izderadicka/suppress_dead_code_warnings

Mark dead code explicitly
This commit is contained in:
Igor Katson 2024-08-02 09:00:33 +01:00 committed by GitHub
commit 91f03cb81d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 0 deletions

View file

@ -155,6 +155,7 @@ impl IntoResponse for ApiError {
pub trait ApiErrorExt<T> {
fn with_error_status_code(self, s: StatusCode) -> Result<T, ApiError>;
#[allow(dead_code)]
fn with_plaintext_error(self, value: bool) -> Result<T, ApiError>;
}

View file

@ -19,6 +19,7 @@ pub enum ReadMetainfoResult<Rx> {
seen: HashSet<SocketAddr>,
},
ChannelClosed {
#[allow(dead_code)]
seen: HashSet<SocketAddr>,
},
}

View file

@ -150,7 +150,9 @@ impl TorrentStateLocked {
#[derive(Default)]
pub struct TorrentStateOptions {
#[allow(dead_code)]
pub peer_connect_timeout: Option<Duration>,
#[allow(dead_code)]
pub peer_read_write_timeout: Option<Duration>,
}

View file

@ -149,13 +149,18 @@ fn parse_compact_peers(b: &[u8]) -> Vec<SocketAddrV4> {
#[derive(Deserialize, Debug)]
pub struct TrackerResponse<'a> {
#[allow(dead_code)]
#[serde(rename = "warning message", borrow)]
pub warning_message: Option<ByteBuf<'a>>,
#[allow(dead_code)]
pub complete: u64,
pub interval: u64,
#[allow(dead_code)]
#[serde(rename = "min interval")]
pub min_interval: Option<u64>,
#[allow(dead_code)]
pub tracker_id: Option<ByteBuf<'a>>,
#[allow(dead_code)]
pub incomplete: u64,
pub peers: Peers,
}

View file

@ -75,7 +75,9 @@ impl Request {
#[derive(Debug)]
pub struct AnnounceResponse {
pub interval: u32,
#[allow(dead_code)]
pub leechers: u32,
#[allow(dead_code)]
pub seeders: u32,
pub addrs: Vec<SocketAddrV4>,
}