Run "cargo fix --edition-idioms=2018".
This commit is contained in:
parent
730be38867
commit
e00a1c59ae
|
@ -112,7 +112,7 @@ impl TorAddr {
|
|||
}
|
||||
|
||||
impl std::fmt::Display for TorAddr {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self.host {
|
||||
Host::Ip(IpAddr::V6(addr)) => write!(f, "[{}]:{}", addr, self.port),
|
||||
_ => write!(f, "{}:{}", self.host, self.port),
|
||||
|
@ -171,7 +171,7 @@ impl Host {
|
|||
}
|
||||
|
||||
impl std::fmt::Display for Host {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Host::Hostname(s) => write!(f, "{}", s),
|
||||
Host::Ip(ip) => write!(f, "{}", ip),
|
||||
|
|
|
@ -55,7 +55,7 @@ impl<N> Readable for GenericArray<u8, N>
|
|||
where
|
||||
N: generic_array::ArrayLength<u8>,
|
||||
{
|
||||
fn take_from(b: &mut Reader) -> Result<Self> {
|
||||
fn take_from(b: &mut Reader<'_>) -> Result<Self> {
|
||||
// safety -- "take" returns the requested bytes or error.
|
||||
Ok(Self::clone_from_slice(b.take(N::to_usize())?))
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ mod test {
|
|||
use tor_linkspec::ChanTarget;
|
||||
use tor_netdir::testnet;
|
||||
|
||||
fn assert_exit_path_ok(relays: &[Relay]) {
|
||||
fn assert_exit_path_ok(relays: &[Relay<'_>]) {
|
||||
assert_eq!(relays.len(), 3);
|
||||
|
||||
// TODO: Eventually assert that r1 has Guard, once we enforce that.
|
||||
|
|
|
@ -775,7 +775,7 @@ impl NetDir {
|
|||
/// [`RouterStatus`] rather than a [`Relay`].
|
||||
pub fn total_weight<P>(&self, role: WeightRole, usable: P) -> RelayWeight
|
||||
where
|
||||
P: Fn(&UncheckedRelay) -> bool,
|
||||
P: Fn(&UncheckedRelay<'_>) -> bool,
|
||||
{
|
||||
self.all_relays()
|
||||
.filter_map(|unchecked| {
|
||||
|
|
Loading…
Reference in New Issue