chiark / gitweb /
clippy nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 Aug 2020 00:49:32 +0000 (01:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 Aug 2020 00:49:32 +0000 (01:49 +0100)
src/api.rs
src/cmdlistener.rs
src/keydata.rs
src/lib.rs
src/session.rs
src/slotmap-slot-idx.rs

index df5d5b722f1a3b1cc0cd9824fab3df2cfc167f5f..8fa5210940a4b78d6f7f134f68cd84ecd7c9d42b 100644 (file)
@@ -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,
-  ]);
+  ])
 }
index a257c482c37be09dd12aeaed643f0b7fe46b05e3..cb46db42cd016af0e28ee6615b8d1bccaee85861 100644 (file)
@@ -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
   }
 }
 
index 65158c298d4ee6a3abcd8c7efaead5ad48c81f5b..cc5a6b82153a075148c60638af559179df6dac4a 100644 (file)
@@ -1,3 +1,4 @@
+#![allow(clippy::many_single_char_names)]
 
 use crate::imports::*;
 
index 5ed5f2f28662db35b123cab4637a1da06cd15a18..8636c34fa8d2cb1b4f9b4de451f208eebf612416 100644 (file)
@@ -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;
index c326d725d853a4e47b172bc8f6c0b604fdebbc6f..c512e9313bf8077cda3e62444d7f8f74128ea5b0 100644 (file)
@@ -128,7 +128,7 @@ fn session(form : Json<SessionForm>) -> Result<Template,OE> {
 }
 
 pub fn mount(rocket_instance: Rocket) -> Rocket {
-  return rocket_instance.mount("/", routes![
+  rocket_instance.mount("/", routes![
     session,
-  ]);
+  ])
 }
index 4825864c644ee44eae3bdd136a6422e74727e8b9..1d0ad29030229a0cc8d057e080fb94ad7e86a73a 100644 (file)
@@ -201,7 +201,7 @@ impl Serializer for ValueExtractor {
 }
 
 impl ser::Error for Error {
-  fn custom<T>(_msg: T) -> Self { return Error::WasCustomSerialize; }
+  fn custom<T>(_msg: T) -> Self { Error::WasCustomSerialize }
 }
 
 impl fmt::Display for Error {