Commit 700e4918 authored by Nick Mathewson's avatar Nick Mathewson 🦞
Browse files

Remove allow(clippy::disallowed_methods) lint.

parent fd081742
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
disallowed-methods = [
    { path = "std::time::SystemTime::now", reason = "prefere using SleepProvider::wallclock instead when possible" },
#    { path = "std::time::SystemTime::now", reason = "prefere using SleepProvider::wallclock instead when possible" },
]
+0 −1
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@
// This file uses `unwrap()` a fair deal, but this is fine in test/bench code
// because it's OK if tests and benchmarks simply crash if things go wrong.
#![allow(clippy::unwrap_used)]
#![allow(clippy::disallowed_methods)]

use anyhow::{anyhow, Result};
use arti::cfg::ArtiConfig;
+0 −2
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ impl BootstrapStatus {
    /// 0 is defined as "just started"; 1 is defined as "ready to use."
    pub fn as_frac(&self) -> f32 {
        // Coefficients chosen arbitrarily.
        #[allow(clippy::disallowed_methods)]
        let res =
            self.conn_status.frac() * 0.15 + self.dir_status.frac_at(SystemTime::now()) * 0.85;
        res
@@ -50,7 +49,6 @@ impl BootstrapStatus {
    /// For the purposes of this function, the client is "ready for traffic" if,
    /// as far as we know, we can start acting on a new client request immediately.
    pub fn ready_for_traffic(&self) -> bool {
        #[allow(clippy::disallowed_methods)]
        let now = SystemTime::now();
        self.conn_status.usable() && self.dir_status.usable_at(now)
    }
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ pub trait Timebound<T>: Sized {

    /// Unwrap this Timebound object if it is valid now.
    fn check_valid_now(self) -> Result<T, Self::Error> {
        #[allow(clippy::disallowed_methods)]
        self.check_valid_at(&time::SystemTime::now())
    }

+0 −3
Original line number Diff line number Diff line
@@ -265,7 +265,6 @@ mod test {
        let dirinfo = (&netdir).into();
        let config = PathConfig::default();
        let guards: OptDummyGuardMgr<'_> = None;
        #[allow(clippy::disallowed_methods)]
        let now = SystemTime::now();

        for _ in 0..1000 {
@@ -311,7 +310,6 @@ mod test {
            .unwrap();
        let dirinfo = (&netdir).into();
        let guards: OptDummyGuardMgr<'_> = None;
        #[allow(clippy::disallowed_methods)]
        let now = SystemTime::now();

        let config = PathConfig::default();
@@ -359,7 +357,6 @@ mod test {
        let dirinfo = (&netdir).into();
        let guards: OptDummyGuardMgr<'_> = None;
        let config = PathConfig::default();
        #[allow(clippy::disallowed_methods)]
        let now = SystemTime::now();

        // With target ports
Loading