Skip to content

Commit

Permalink
plugin: deny unwrap call
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Mar 24, 2024
1 parent 0fa3096 commit 7138010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions plugin/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,9 @@ impl<'a, T: 'a + Clone> Plugin<T> {
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.
Expand Down

0 comments on commit 7138010

Please sign in to comment.