summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-21 15:32:28 +0300
committerLars Wirzenius <liw@sequoia-pgp.org>2021-09-30 08:31:02 +0300
commit5ccc49ae6b711a926e6d1036b1c902c2bbb1d47a (patch)
tree674311b3e5b5346ee4199f3d98e17054acd3c002 /ipc
parent6b0a74801c45304fe8c9891a5addae03b56a0420 (diff)
Drop unnecessary return statements
Instead of "return foo" as the last statement executed in a function, just use "foo", which is more idiomatic style. This was found by the clippy lint needless_return: https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
Diffstat (limited to 'ipc')
-rw-r--r--ipc/src/assuan/socket.rs2
-rw-r--r--ipc/src/sexp/parse/lexer.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/ipc/src/assuan/socket.rs b/ipc/src/assuan/socket.rs
index 1e69cb39..a265e96a 100644
--- a/ipc/src/assuan/socket.rs
+++ b/ipc/src/assuan/socket.rs
@@ -158,7 +158,7 @@ fn read_port_and_nonce_from_string(contents: &[u8]) -> Result<Rendezvous> {
};
Ok(Rendezvous { port, nonce, uds_emulation: UdsEmulation::Cygwin })
},
- _ => return Err(anyhow!("Couldn't parse Cygwin socket: {}", buf)),
+ _ => Err(anyhow!("Couldn't parse Cygwin socket: {}", buf)),
}
},
// libassuan's own socket emulation
diff --git a/ipc/src/sexp/parse/lexer.rs b/ipc/src/sexp/parse/lexer.rs
index 8d091e25..bd641fef 100644
--- a/ipc/src/sexp/parse/lexer.rs
+++ b/ipc/src/sexp/parse/lexer.rs
@@ -84,10 +84,10 @@ impl<'input> Iterator for Lexer<'input> {
let len_token = (|input: &'input [u8]| {
let c = input.iter().next()?;
match *c as char {
- '(' => return Some(Ok((1, LPAREN))),
- ')' => return Some(Ok((1, RPAREN))),
- '[' => return Some(Ok((1, LBRACKET))),
- ']' => return Some(Ok((1, RBRACKET))),
+ '(' => Some(Ok((1, LPAREN))),
+ ')' => Some(Ok((1, RPAREN))),
+ '[' => Some(Ok((1, LBRACKET))),
+ ']' => Some(Ok((1, RBRACKET))),
'0'..='9' => {
for (i, c) in input.iter().enumerate() {
let offset = i + 1; // Offset in input.
@@ -126,7 +126,7 @@ impl<'input> Iterator for Lexer<'input> {
Some(Err(LexicalError::TruncatedInput(
format!("Expected colon and data after {:?}", len))))
},
- _ => return Some(Err(LexicalError::UnexpectedCharacter(
+ _ => Some(Err(LexicalError::UnexpectedCharacter(
format!("Unexpected character {}", *c as char)))),
}
})(&self.input)?;