summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-28 20:24:25 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:15 +0300
commit176fe4658b6c03b0dce1f2d2d1431090db31473f (patch)
tree7cb39ad3f806f1e333116a398b911a42226933c4
parent2fa7cb8ead4e1be702ebc6ff580ec3dae969cc1f (diff)
Be explicit about giving Ok() the unit value
Instead of giving Ok() the return value of a function that returns no value, i.e., the unit value (), give it explicitly. This is clearer and easier to follow for the reader. Found by clippy lint unit_arg: https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
-rw-r--r--ipc/src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipc/src/lib.rs b/ipc/src/lib.rs
index 3f1c1138..734725bb 100644
--- a/ipc/src/lib.rs
+++ b/ipc/src/lib.rs
@@ -287,10 +287,11 @@ impl Descriptor {
fn spawn(&self, l: TcpListener) -> Result<()> {
let descriptor = self.clone();
thread::spawn(move || -> Result<()> {
- Ok(Server::new(descriptor)
+ Server::new(descriptor)
.expect("Failed to spawn server") // XXX
.serve_listener(l)
- .expect("Failed to spawn server")) // XXX
+ .expect("Failed to spawn server"); // XXX
+ Ok(())
});
Ok(())
}