map: bump release version #432
clippy
57 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 57 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.80.0 (051478957 2024-07-21)
- cargo 1.80.0 (376290515 2024-07-16)
- clippy 0.1.80 (0514789 2024-07-21)
Annotations
Check warning on line 47 in tests/src/lib.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> tests/src/lib.rs:47:9
|
46 | let cln = async_run!(cln::Node::with_params("--developer", "regtest")).unwrap();
| -------------------------------------------------------------------------------- unnecessary `let` binding
47 | cln
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
46 ~
47 ~ async_run!(cln::Node::with_params("--developer", "regtest")).unwrap()
|
Check warning on line 40 in tests/src/lib.rs
github-actions / clippy
returning the result of a `let` binding from a block
warning: returning the result of a `let` binding from a block
--> tests/src/lib.rs:40:9
|
39 | ... let cln = async_run!(cln::Node::with_params(&format!("--developer --plugin={pwd}/target/debug/examples/foo_plugin --plugin={pwd}/target/debug/examples/macros_ex"), "regtest")).unwrap();
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- unnecessary `let` binding
40 | ... cln
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
39 ~
40 ~ async_run!(cln::Node::with_params(&format!("--developer --plugin={pwd}/target/debug/examples/foo_plugin --plugin={pwd}/target/debug/examples/macros_ex"), "regtest")).unwrap()
|
Check warning on line 85 in testing/src/cln.rs
github-actions / clippy
usage of an `Arc` that is not `Send` and `Sync`
warning: usage of an `Arc` that is not `Send` and `Sync`
--> testing/src/cln.rs:85:19
|
85 | let btc = Arc::new(btc);
| ^^^^^^^^^^^^^
|
= note: `Arc<BtcNode>` is not `Send` and `Sync` as `BtcNode` is not `Sync`
= help: if the `Arc` will not used be across threads replace it with an `Rc`
= help: otherwise make `BtcNode` `Send` and `Sync` or consider a wrapper type such as `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
= note: `#[warn(clippy::arc_with_non_send_sync)]` on by default
Check warning on line 120 in testing/src/btc.rs
github-actions / clippy
this `RefCell` reference is held across an `await` point
warning: this `RefCell` reference is held across an `await` point
--> testing/src/btc.rs:120:24
|
120 | for process in self.process.borrow_mut().iter_mut() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the `await` points this reference is held through
--> testing/src/btc.rs:121:28
|
121 | process.kill().await?;
| ^^^^^
122 | let _ = process.wait().await?;
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_refcell_ref
= note: `#[warn(clippy::await_holding_refcell_ref)]` on by default
Check warning on line 32 in testing/src/lib.rs
github-actions / clippy
`crate` references the macro call's crate
warning: `crate` references the macro call's crate
--> testing/src/lib.rs:32:17
|
32 | use crate::DEFAULT_TIMEOUT;
| ^^^^^ help: to reference the macro definition's crate, use: `$crate`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
= note: `#[warn(clippy::crate_in_macro_def)]` on by default
Check warning on line 30 in plugin/src/types.rs
github-actions / clippy
this `let...else` may be rewritten with the `?` operator
warning: this `let...else` may be rewritten with the `?` operator
--> plugin/src/types.rs:28:9
|
28 | / let Some(ref value) = self.value else {
29 | | return None;
30 | | };
| |__________^ help: replace it with: `let ref value = self.value?;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
= note: `#[warn(clippy::question_mark)]` on by default
Check warning on line 282 in plugin/src/plugin.rs
github-actions / clippy
redundant pattern matching, consider using `is_ok()`
warning: redundant pattern matching, consider using `is_ok()`
--> plugin/src/plugin.rs:282:19
|
282 | while let Ok(_) = reader.read_line(&mut buffer) {
| ----------^^^^^-------------------------------- help: try: `while reader.read_line(&mut buffer).is_ok()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
Check warning on line 145 in plugin/src/plugin.rs
github-actions / clippy
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> plugin/src/plugin.rs:145:25
|
145 | "string" => def_val.and_then(|val| Some(serde_json::json!(val))),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `def_val.map(|val| serde_json::json!(val))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
Check warning on line 144 in plugin/src/plugin.rs
github-actions / clippy
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> plugin/src/plugin.rs:144:22
|
144 | "int" => def_val.and_then(|val| Some(serde_json::json!(val.parse::<i64>().unwrap()))),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `def_val.map(|val| serde_json::json!(val.parse::<i64>().unwrap()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
Check warning on line 142 in plugin/src/plugin.rs
github-actions / clippy
using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> plugin/src/plugin.rs:142:17
|
142 | def_val.and_then(|val| Some(serde_json::json!(val.parse::<bool>().unwrap())))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `def_val.map(|val| serde_json::json!(val.parse::<bool>().unwrap()))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
= note: `#[warn(clippy::bind_instead_of_map)]` on by default
Check warning on line 53 in plugin/src/plugin.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> plugin/src/plugin.rs:53:14
|
53 | on_init: Option<Arc<dyn Fn(&mut Plugin<T>) -> Value>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
Check warning on line 27 in plugin/src/commands/mod.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'c
warning: the following explicit lifetimes could be elided: 'c
--> plugin/src/commands/mod.rs:27:18
|
27 | fn call_void<'c>(&self, _plugin: &mut Plugin<T>, _request: &'c serde_json::Value) {}
| ^^ ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
27 - fn call_void<'c>(&self, _plugin: &mut Plugin<T>, _request: &'c serde_json::Value) {}
27 + fn call_void(&self, _plugin: &mut Plugin<T>, _request: &serde_json::Value) {}
|
Check warning on line 18 in plugin/src/commands/mod.rs
github-actions / clippy
this lifetime isn't used in the function definition
warning: this lifetime isn't used in the function definition
--> plugin/src/commands/mod.rs:18:13
|
18 | fn call<'c>(
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
Check warning on line 54 in plugin/src/commands/builtin.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> plugin/src/commands/builtin.rs:54:25
|
54 | pub(crate) on_init: Option<Arc<dyn Fn(&mut Plugin<T>) -> Value>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
Check warning on line 6 in plugin/src/lib.rs
github-actions / clippy
doc list item missing indentation
warning: doc list item missing indentation
--> plugin/src/lib.rs:6:5
|
6 | //! When enable provide the typed API to the plugin
| ^
|
= help: if this is supposed to be its own paragraph, add a blank line
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
= note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
|
6 | //! When enable provide the typed API to the plugin
| +
Check warning on line 236 in plugin/src/plugin.rs
github-actions / clippy
bound is defined in more than one place
warning: bound is defined in more than one place
--> plugin/src/plugin.rs:236:34
|
236 | pub fn register_notification<F: 'static>(&mut self, name: &str, callback: F) -> Self
| ^
237 | where
238 | F: 'static + RPCCommand<T> + Clone,
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
Check warning on line 216 in plugin/src/plugin.rs
github-actions / clippy
bound is defined in more than one place
warning: bound is defined in more than one place
--> plugin/src/plugin.rs:216:26
|
216 | pub fn register_hook<F: 'static>(
| ^
...
224 | F: RPCCommand<T> + 'static,
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
Check warning on line 168 in plugin/src/plugin.rs
github-actions / clippy
bound is defined in more than one place
warning: bound is defined in more than one place
--> plugin/src/plugin.rs:168:27
|
168 | pub fn add_rpc_method<F: 'static>(
| ^
...
176 | F: RPCCommand<T> + 'static,
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
Check warning on line 106 in plugin/src/plugin.rs
github-actions / clippy
bound is defined in more than one place
warning: bound is defined in more than one place
--> plugin/src/plugin.rs:106:20
|
106 | pub fn on_init<C: 'static>(&'a mut self, callback: C) -> Self
| ^
107 | where
108 | C: Fn(&mut Plugin<T>) -> Value,
| ^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
= note: `#[warn(clippy::multiple_bound_locations)]` on by default
Check warning on line 71 in plugin_macros/src/plugin.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> plugin_macros/src/plugin.rs:61:1
|
61 | / impl Default for PluginDeclaration {
62 | | fn default() -> Self {
63 | | Self {
64 | | state: None,
... |
70 | | }
71 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
9 + #[derive(Default)]
10 | pub struct PluginDeclaration {
|
Check warning on line 45 in plugin_macros/src/plugin.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> plugin_macros/src/plugin.rs:45:47
|
45 | let mut inner = KTokenStream::new(&inner);
| ^^^^^^ help: change this to: `inner`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 30 in plugin_macros/src/plugin.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> plugin_macros/src/plugin.rs:30:47
|
30 | let mut inner = KTokenStream::new(&inner);
| ^^^^^^ help: change this to: `inner`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 15 in plugin_macros/src/lib.rs
github-actions / clippy
struct `Tracer` is never constructed
warning: struct `Tracer` is never constructed
--> plugin_macros/src/lib.rs:15:8
|
15 | struct Tracer;
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 195 in gossip_map/src/lib.rs
github-actions / clippy
usage of `contains_key` followed by `insert` on a `HashMap`
warning: usage of `contains_key` followed by `insert` on a `HashMap`
--> gossip_map/src/lib.rs:192:21
|
192 | / if !self.nodes.contains_key(&node_id) {
193 | | let node = GossipNode::new(node_id.clone(), Some(node_announcement));
194 | | self.nodes.insert(node_id, node);
195 | | }
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
= note: `#[warn(clippy::map_entry)]` on by default
help: try
|
192 ~ self.nodes.entry(node_id).or_insert_with(|| {
193 + let node = GossipNode::new(node_id.clone(), Some(node_announcement));
194 + node
195 + });
|
Check warning on line 128 in gossip_map/src/lib.rs
github-actions / clippy
unnecessary use of `to_vec`
warning: unnecessary use of `to_vec`
--> gossip_map/src/lib.rs:128:50
|
128 | GossipNodeId::from_bytes(&channel_announcement.node_id_2.to_vec()).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `channel_announcement.node_id_2.as_ref()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned