From 7138010c40625d59da6bd62499377951a7bdeafd Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Sun, 24 Mar 2024 02:30:12 +0100 Subject: [PATCH] plugin: deny unwrap call Signed-off-by: Vincenzo Palazzo --- plugin/src/lib.rs | 1 + plugin/src/plugin.rs | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/src/lib.rs b/plugin/src/lib.rs index dff9fde..5bb3d2c 100644 --- a/plugin/src/lib.rs +++ b/plugin/src/lib.rs @@ -7,6 +7,7 @@ //! //! author and mantainer: Vincenzo Palazzo https://github.com/vincenzopalazzo #![crate_name = "clightningrpc_plugin"] +#![deny(clippy::unwrap_used)] pub mod commands; pub mod errors; mod io; diff --git a/plugin/src/plugin.rs b/plugin/src/plugin.rs index 5826fa7..28c0d4d 100644 --- a/plugin/src/plugin.rs +++ b/plugin/src/plugin.rs @@ -122,10 +122,9 @@ impl<'a, T: 'a + Clone> Plugin { method: "log".to_owned(), params: payload, }; - writer - .write_all(serde_json::to_string(&request).unwrap().as_bytes()) - .unwrap(); - writer.flush().unwrap(); + // We do not like unwrap there + let _ = writer.write_all(serde_json::to_string(&request).unwrap().as_bytes()); + let _ = writer.flush(); } /// register the plugin option.