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 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
Check warning on line 126 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:126:50
|
126 | GossipNodeId::from_bytes(&channel_announcement.node_id_1.to_vec()).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `channel_announcement.node_id_1.as_ref()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
= note: `#[warn(clippy::unnecessary_to_owned)]` on by default
Check warning on line 134 in gossip_map/src/gossip_types.rs
github-actions / clippy
useless conversion to the same type: `u64`
warning: useless conversion to the same type: `u64`
--> gossip_map/src/gossip_types.rs:134:29
|
134 | self.satoshi = Some(amount.satoshis.into());
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `amount.satoshis`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 84 in gossip_map/src/bolt7.rs
github-actions / clippy
this function has too many arguments (9/7)
warning: this function has too many arguments (9/7)
--> gossip_map/src/bolt7.rs:84:10
|
84 | #[derive(DecodeWire, EncodeWire, Debug, Clone)]
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: this warning originates in the derive macro `DecodeWire` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 36 in gossip_map/src/bolt7.rs
github-actions / clippy
this function has too many arguments (12/7)
warning: this function has too many arguments (12/7)
--> gossip_map/src/bolt7.rs:36:10
|
36 | #[derive(DecodeWire, EncodeWire, Debug, Clone)]
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: this warning originates in the derive macro `DecodeWire` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 19 in gossip_map/src/bolt7.rs
github-actions / clippy
this function has too many arguments (12/7)
warning: this function has too many arguments (12/7)
--> gossip_map/src/bolt7.rs:19:10
|
19 | #[derive(DecodeWire, EncodeWire, Debug, Clone)]
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the derive macro `DecodeWire` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 160 in gossip_map/src/gossip_types.rs
github-actions / clippy
fields `crc` and `timestamp` are never read
warning: fields `crc` and `timestamp` are never read
--> gossip_map/src/gossip_types.rs:160:5
|
157 | pub struct GossipStoredHeader {
| ------------------ fields in this struct
...
160 | crc: u32,
| ^^^
161 | timestamp: u32,
| ^^^^^^^^^
|
= note: `GossipStoredHeader` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
Check warning on line 145 in gossip_map/src/gossip_types.rs
github-actions / clippy
field `inner` is never read
warning: field `inner` is never read
--> gossip_map/src/gossip_types.rs:145:9
|
144 | pub struct GossipPartialChannel {
| -------------------- field in this struct
145 | pub inner: ChannelUpdate,
| ^^^^^
|
= note: `GossipPartialChannel` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 84 in gossip_map/src/gossip_types.rs
github-actions / clippy
fields `inner`, `annound_offset`, `scid`, `update_fields`, and `update_offset` are never read
warning: fields `inner`, `annound_offset`, `scid`, `update_fields`, and `update_offset` are never read
--> gossip_map/src/gossip_types.rs:84:5
|
83 | pub struct GossipChannel {
| ------------- fields in this struct
84 | inner: ChannelAnnouncement,
| ^^^^^
85 | annound_offset: u32,
| ^^^^^^^^^^^^^^
86 | scid: ShortChannelId,
| ^^^^
...
89 | update_fields: Vec<HashMap<String, String>>,
| ^^^^^^^^^^^^^
90 | update_offset: Vec<u32>,
| ^^^^^^^^^^^^^
|
= note: `GossipChannel` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
Check warning on line 50 in gossip_map/src/gossip_types.rs
github-actions / clippy
field `raw_message` is never read
warning: field `raw_message` is never read
--> gossip_map/src/gossip_types.rs:50:5
|
47 | pub struct GossipNode {
| ---------- field in this struct
...
50 | raw_message: Option<NodeAnnouncement>,
| ^^^^^^^^^^^
|
= note: `GossipNode` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
Check warning on line 14 in gossip_map/src/gossip_types.rs
github-actions / clippy
trait `GossipType` is never used
warning: trait `GossipType` is never used
--> gossip_map/src/gossip_types.rs:14:7
|
14 | trait GossipType {
| ^^^^^^^^^^
Check warning on line 49 in gossip_map/src/gossip_stor_wiregen.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/gossip_stor_wiregen.rs:49:9
|
47 | pub struct GossipStorePrivateUpdateObs {
| --------------------------- field in this struct
48 | #[msg_type = 4102]
49 | pub ty: u16,
| ^^
|
= note: `GossipStorePrivateUpdateObs` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 41 in gossip_map/src/gossip_stor_wiregen.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/gossip_stor_wiregen.rs:41:9
|
39 | pub struct GossipStorePrivateChannelObs {
| ---------------------------- field in this struct
40 | #[msg_type = 4104]
41 | pub ty: u16,
| ^^
|
= note: `GossipStorePrivateChannelObs` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 34 in gossip_map/src/gossip_stor_wiregen.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/gossip_stor_wiregen.rs:34:9
|
32 | pub struct GossipStoreEnded {
| ---------------- field in this struct
33 | #[msg_type = 4105]
34 | pub ty: u16,
| ^^
|
= note: `GossipStoreEnded` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 27 in gossip_map/src/gossip_stor_wiregen.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/gossip_stor_wiregen.rs:27:9
|
25 | pub struct GossipStoreDeleteChan {
| --------------------- field in this struct
26 | #[msg_type = 4103]
27 | pub ty: u16,
| ^^
|
= note: `GossipStoreDeleteChan` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 12 in gossip_map/src/gossip_stor_wiregen.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/gossip_stor_wiregen.rs:12:9
|
10 | pub struct GossipStoreChanDying {
| -------------------- field in this struct
11 | #[msg_type = 4106]
12 | pub ty: u16,
| ^^
|
= note: `GossipStoreChanDying` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
Check warning on line 13 in gossip_map/src/flags.rs
github-actions / clippy
constant `GOSSIP_STORE_LEN_RATELIMIT_BIT` is never used
warning: constant `GOSSIP_STORE_LEN_RATELIMIT_BIT` is never used
--> gossip_map/src/flags.rs:13:11
|
13 | pub const GOSSIP_STORE_LEN_RATELIMIT_BIT: u16 = 0x2000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 10 in gossip_map/src/flags.rs
github-actions / clippy
constant `GOSSIP_STORE_LEN_PUSH_BIT` is never used
warning: constant `GOSSIP_STORE_LEN_PUSH_BIT` is never used
--> gossip_map/src/flags.rs:10:11
|
10 | pub const GOSSIP_STORE_LEN_PUSH_BIT: u16 = 0x4000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Check warning on line 132 in gossip_map/src/bolt7.rs
github-actions / clippy
field `ty` is never read
warning: field `ty` is never read
--> gossip_map/src/bolt7.rs:132:9
|
130 | pub struct ReplyShortChannelIdsEnd {
| ----------------------- field in this struct
131 | #[msg_type = 262]
132 | pub ty: u16,
| ^^
|
= note: `ReplyShortChannelIdsEnd` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis