Skip to content

Commit 4f49d89

Browse files
committed
satisfy clippy
allowed len_without_is_empty because we use that in several places
1 parent 0e03b83 commit 4f49d89

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#![forbid(unsafe_code)]
5858
#![deny(missing_debug_implementations, nonstandard_style)]
5959
#![warn(missing_docs, unreachable_pub, future_incompatible, rust_2018_idioms)]
60+
#![allow(clippy::len_without_is_empty)]
6061
#![doc(test(attr(deny(warnings))))]
6162
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
6263
#![doc(html_favicon_url = "https://yoshuawuyts.com/assets/http-rs/favicon.ico")]

src/listener/unix_listener.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ impl<State> Display for UnixListener<State> {
161161
}
162162

163163
fn unix_socket_addr_to_string(result: io::Result<SocketAddr>) -> Option<String> {
164-
result.ok().and_then(|addr| {
165-
if let Some(pathname) = addr.as_pathname().and_then(|p| p.canonicalize().ok()) {
166-
Some(format!("http+unix://{}", pathname.display()))
167-
} else {
168-
None
169-
}
170-
})
164+
result
165+
.ok()
166+
.as_ref()
167+
.and_then(SocketAddr::as_pathname)
168+
.and_then(|p| p.canonicalize().ok())
169+
.map(|pathname| format!("http+unix://{}", pathname.display()))
171170
}

0 commit comments

Comments
 (0)