1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 03:21:08 +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> { pub fn realip_remote_addr(&self) -> Option<&str> {
self.realip_remote_addr self.realip_remote_addr
.as_deref() .as_deref()
.or_else(|| self.peer_addr.as_deref()) .or(self.peer_addr.as_deref())
} }
/// Returns serialized IP address of the peer connection. /// Returns serialized IP address of the peer connection.

View file

@ -151,7 +151,7 @@ impl ResourceMap {
.char_indices() .char_indices()
.filter_map(|(i, c)| (c == '/').then(|| i)) .filter_map(|(i, c)| (c == '/').then(|| i))
.nth(2) .nth(2)
.unwrap_or_else(|| path.len()); .unwrap_or(path.len());
( (
Cow::Borrowed(&path[..third_slash_index]), Cow::Borrowed(&path[..third_slash_index]),