From: Ian Jackson Date: Mon, 3 Aug 2020 00:49:32 +0000 (+0100) Subject: clippy nfc X-Git-Tag: otter-0.2.0~1190 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7d5659ce5228ebd6e974ad8a032e43342c87a300;p=otter.git clippy nfc --- diff --git a/src/api.rs b/src/api.rs index df5d5b72..8fa52109 100644 --- a/src/api.rs +++ b/src/api.rs @@ -213,10 +213,10 @@ impl ApiPieceOp for ApiPieceMove { } pub fn mount(rocket_instance: Rocket) -> Rocket { - return rocket_instance.mount("/", routes![ + rocket_instance.mount("/", routes![ api_grab, api_ungrab, api_raise, api_move, - ]); + ]) } diff --git a/src/cmdlistener.rs b/src/cmdlistener.rs index a257c482..cb46db42 100644 --- a/src/cmdlistener.rs +++ b/src/cmdlistener.rs @@ -46,6 +46,7 @@ impl CommandStream<'_> { while let Some(l) = self.read.next() { let l = l.context("read")?; decode_and_process(&mut self, &l)?; + #[allow(clippy::write_with_newline)] write!(&mut self.write, "\n")?; self.write.flush()?; } @@ -107,7 +108,7 @@ impl CommandStream<'_> { fn map_auth_err(&self, ae: AuthorisationError) -> MgmtError { eprintln!("command connection {}: authorisation error: {}", self.desc, ae.0); - return MgmtError::AuthorisationError; + MgmtError::AuthorisationError } } diff --git a/src/keydata.rs b/src/keydata.rs index 65158c29..cc5a6b82 100644 --- a/src/keydata.rs +++ b/src/keydata.rs @@ -1,3 +1,4 @@ +#![allow(clippy::many_single_char_names)] use crate::imports::*; diff --git a/src/lib.rs b/src/lib.rs index 5ed5f2f2..8636c34f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,8 @@ #![feature(proc_macro_hygiene, decl_macro)] #![feature(slice_strip)] +#![allow(clippy::redundant_closure_call)] + pub mod imports; pub mod global; pub mod pieces; diff --git a/src/session.rs b/src/session.rs index c326d725..c512e931 100644 --- a/src/session.rs +++ b/src/session.rs @@ -128,7 +128,7 @@ fn session(form : Json) -> Result { } pub fn mount(rocket_instance: Rocket) -> Rocket { - return rocket_instance.mount("/", routes![ + rocket_instance.mount("/", routes![ session, - ]); + ]) } diff --git a/src/slotmap-slot-idx.rs b/src/slotmap-slot-idx.rs index 4825864c..1d0ad290 100644 --- a/src/slotmap-slot-idx.rs +++ b/src/slotmap-slot-idx.rs @@ -201,7 +201,7 @@ impl Serializer for ValueExtractor { } impl ser::Error for Error { - fn custom(_msg: T) -> Self { return Error::WasCustomSerialize; } + fn custom(_msg: T) -> Self { Error::WasCustomSerialize } } impl fmt::Display for Error {