Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Mar 2, 2022
1 parent 25c0673 commit 3f03af1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion actix-web/src/info.rs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion actix-web/src/rmap.rs
Expand Up @@ -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]),
Expand Down

0 comments on commit 3f03af1

Please sign in to comment.