parent
b151237a7f
commit
d1ed505b61
|
@ -1,3 +1,4 @@
|
|||
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 = "std::time::SystemTime::now", reason = "prefer using SleepProvider::wallclock instead when possible" },
|
||||
]
|
||||
|
|
|
@ -123,6 +123,7 @@ pub trait RngExt: Rng {
|
|||
if range.is_empty() {
|
||||
None
|
||||
} else {
|
||||
#[allow(clippy::disallowed_methods)]
|
||||
Some(Rng::gen_range(self, range))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue