summaryrefslogtreecommitdiff
path: root/clippy.toml
blob: c822482a5bcea3778b3ab60d34e05638d0cec372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
disallowed-types = [
    { path = "futures::channel::oneshot::Sender", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "futures::channel::oneshot::Receiver", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "futures::task::SpawnExt", reason = "use `tor_rtcompat::SpawnExt`, which is compatible with tokio-console" },
]
disallowed-methods = [
    { path = "rand::Rng::gen_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" },
    { path = "rand::Rng::random_range", reason = "Prefer tor_basic_utils::RngExt::gen_range_checked to avoid uncontrolled panics, or gen_range_infallible if applicable" },
    { path = "futures::channel::oneshot::channel", reason = "Use tor_async_utils::oneshot to avoid bug with select macro" },
    { path = "std::path::Path::display", reason = "See tor_basic_utils::PathExt::display_lossy" },
#    { path = "std::time::SystemTime::now", reason = "prefer using SleepProvider::wallclock instead when possible" },
    { path = "std::path::Path::exists", reason = "Prefer using std::Path::try_exists or std::fs::exists" },
    { path = "retry_error::RetryError::push", reason = "Use push_timed with mockable time sources instead of push which calls SystemTime::now" },
    { path = "retry_error::RetryError::extend", reason = "Use push_timed in a loop with mockable time sources instead of extend which calls push internally" },
]