From 3f03af1c5928e1c4ea0cfab4d2ddfc7043b571f1 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 2 Mar 2022 03:25:30 +0000 Subject: [PATCH] clippy --- actix-web/src/info.rs | 2 +- actix-web/src/rmap.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actix-web/src/info.rs b/actix-web/src/info.rs index ce1ef97c6..77b98110e 100644 --- a/actix-web/src/info.rs +++ b/actix-web/src/info.rs @@ -159,7 +159,7 @@ impl ConnectionInfo { pub fn realip_remote_addr(&self) -> Option<&str> { self.realip_remote_addr .as_deref() - .or_else(|| self.peer_addr.as_deref()) + .or(self.peer_addr.as_deref()) } /// Returns serialized IP address of the peer connection. diff --git a/actix-web/src/rmap.rs b/actix-web/src/rmap.rs index 932f7acde..6a1a187b2 100644 --- a/actix-web/src/rmap.rs +++ b/actix-web/src/rmap.rs @@ -151,7 +151,7 @@ impl ResourceMap { .char_indices() .filter_map(|(i, c)| (c == '/').then(|| i)) .nth(2) - .unwrap_or_else(|| path.len()); + .unwrap_or(path.len()); ( Cow::Borrowed(&path[..third_slash_index]),