Merge branch 'clippy_pass' into 'main'

Make clippy +nightly pass again

See merge request tpo/core/arti!522
This commit is contained in:
Ian Jackson 2022-05-24 13:21:24 +00:00
commit dae2ccd692
14 changed files with 16 additions and 14 deletions

View File

@ -78,7 +78,7 @@ struct CustomTcpStream<T> {
}
/// An enum representing states a TCP stream can be in.
#[derive(PartialEq)]
#[derive(PartialEq, Eq)]
enum TcpState {
/// Stream is open.
Open,

View File

@ -414,6 +414,7 @@ where
#[cfg(test)]
#[allow(clippy::unwrap_used)] // why is this not the default in tests
#[allow(clippy::print_stderr)]
mod test {
use super::*;
use futures::channel::mpsc;

View File

@ -38,6 +38,7 @@
#![deny(clippy::unnecessary_wraps)]
#![warn(clippy::unseparated_literal_suffix)]
#![deny(clippy::unwrap_used)]
#![allow(clippy::let_unit_value)]
use std::fmt;

View File

@ -462,7 +462,7 @@ pub(crate) mod test {
}
}
#[derive(PartialEq, Clone, Copy, Debug)]
#[derive(PartialEq, Clone, Copy, Debug, Eq)]
struct OtherIsolation(usize);
impl IsolationHelper for OtherIsolation {

View File

@ -273,7 +273,7 @@ pub(crate) trait AbstractCircBuilder: Send + Sync {
/// All circuits start out "unused" and become "dirty" when their spec
/// is first restricted -- that is, when they are first handed out to be
/// used for a request.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
enum ExpirationInfo {
/// The circuit has never been used.
Unused {
@ -303,7 +303,7 @@ impl ExpirationInfo {
}
/// An entry for an open circuit held by an `AbstractCircMgr`.
#[derive(PartialEq, Debug, Clone)]
#[derive(PartialEq, Debug, Clone, Eq)]
pub(crate) struct OpenEntry<S, C> {
/// Current AbstractCircSpec for this circuit's permitted usages.
spec: S,
@ -1456,7 +1456,7 @@ mod test {
}
}
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, Clone, Eq)]
struct FakeCirc {
id: FakeId,
}

View File

@ -18,7 +18,7 @@ use crate::mgr::{abstract_spec_find_supported, AbstractCirc, OpenEntry, Restrict
use crate::Result;
/// An exit policy, as supported by the last hop of a circuit.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) struct ExitPolicy {
/// Permitted IPv4 ports.
v4: Arc<PortPolicy>,

View File

@ -2,7 +2,7 @@
use serde::{Deserialize, Serialize};
/// An event emitted by some Tor-related crate.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[non_exhaustive]
pub enum TorEvent {
/// An event with no data, used for testing purposes.

View File

@ -11,7 +11,7 @@ use tor_llcrypto::pk::rsa::RsaIdentity;
/// A piece of information about a relay and how to connect to it.
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum LinkSpec {
/// The TCP address of an OR Port for a relay
OrPort(IpAddr, u16),

View File

@ -49,7 +49,7 @@ where
/// Internal: how should we find the base bandwidth of each relay? This
/// value is global over a whole directory, and depends on the bandwidth
/// weights in the consensus.
#[derive(Copy, Clone, Debug, PartialEq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
enum BandwidthFn {
/// There are no weights at all in the consensus: weight every
/// relay as 1.

View File

@ -150,7 +150,7 @@ pub struct RouterDesc {
}
/// Description of the software a relay is running.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum RelayPlatform {
/// Software advertised to be some version of Tor, on some platform.

View File

@ -165,7 +165,7 @@ impl fmt::Display for Pos {
}
/// A variety of parsing error.
#[derive(Copy, Clone, Debug, derive_more::Display, PartialEq)]
#[derive(Copy, Clone, Debug, derive_more::Display, PartialEq, Eq)]
#[non_exhaustive]
pub enum ParseErrorKind {
/// An internal error in the parser: these should never happen.

View File

@ -98,7 +98,7 @@ pub type BuildResult<T> = std::result::Result<T, BuildError>;
/// Indicates whether we should parse an annotated list of objects or a
/// non-annotated list.
#[derive(PartialEq, Debug)]
#[derive(PartialEq, Debug, Eq)]
#[allow(clippy::exhaustive_enums)]
pub enum AllowAnnotations {
/// Parsing a document where items might be annotated.

View File

@ -27,7 +27,7 @@ pub use addrpolicy::{AddrPolicy, AddrPortPattern, RuleKind};
pub use portpolicy::PortPolicy;
/// Error from an unparsable or invalid policy.
#[derive(Debug, Error, Clone, PartialEq)]
#[derive(Debug, Error, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum PolicyError {
/// A port was not a number in the range 1..65535

View File

@ -30,7 +30,7 @@ pub struct SocksHandshake {
/// Possible state for a Socks connection.
///
/// Each completed message advances the state.
#[derive(Clone, Debug, Copy, PartialEq)]
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
enum State {
/// Starting state: no messages have been handled yet.
Initial,