1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-22 17:41:11 +00:00
This commit is contained in:
Rob Ede 2022-03-02 03:25:30 +00:00
parent 25c0673278
commit 3f03af1c59
No known key found for this signature in database
GPG key ID: 97C636207D3EF933
2 changed files with 2 additions and 2 deletions

View file

@ -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.

View file

@ -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]),