rust: Update MSRV to 1.70 #1592
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
68 warnings
audit
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/cache@v1, actions-rs/audit-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
audit
1 warnings found!
|
audit
Unknown warning kind unsound found, please, file a bug
|
the borrowed expression implements the required traits:
cli/src/main.rs#L1110
warning: the borrowed expression implements the required traits
--> cli/src/main.rs:1110:35
|
1110 | let tmp_dir = target_dir.join(&format!(
| ___________________________________^
1111 | | "wormhole-tmp-{:06}",
1112 | | rand::thread_rng().gen_range(0..1_000_000)
1113 | | ));
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
help: change this to
|
1110 ~ let tmp_dir = target_dir.join(format!(
1111 + "wormhole-tmp-{:06}",
1112 + rand::thread_rng().gen_range(0..1_000_000)
1113 ~ ));
|
|
question mark operator is useless here:
cli/src/main.rs#L1062
warning: question mark operator is useless here
--> cli/src/main.rs:1062:5
|
1062 | / Ok(req
1063 | | .accept(
1064 | | &transit::log_transit_connection,
1065 | | &mut file,
... |
1069 | | .await
1070 | | .context("Receive process failed")?)
| |____________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
help: try removing question mark and `Ok()`
|
1062 ~ req
1063 + .accept(
1064 + &transit::log_transit_connection,
1065 + &mut file,
1066 + create_progress_handler(pb),
1067 + ctrl_c(),
1068 + )
1069 + .await
1070 + .context("Receive process failed")
|
|
very complex type used. Consider factoring parts into `type` definitions:
cli/src/main.rs#L619
warning: very complex type used. Consider factoring parts into `type` definitions
--> cli/src/main.rs:619:17
|
619 | print_code: Option<
| _________________^
620 | | &dyn Fn(&mut Term, &magic_wormhole::Code, &Option<url::Url>) -> eyre::Result<()>,
621 | | >,
| |_____^
|
= 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
cli/src/main.rs#L573
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> cli/src/main.rs:573:49
|
573 | std::io::stdout().write_all(&out.as_bytes())?;
| ^^^^^^^^^^^^^^^ help: change this to: `out.as_bytes()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
cli/src/main.rs#L423
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> cli/src/main.rs:423:54
|
423 | if with_dilation && peer_allows_dilation(&wormhole.peer_version()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `wormhole.peer_version()`
|
= 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
|
deref on an immutable reference:
cli/src/util.rs#L23
warning: deref on an immutable reference
--> cli/src/util.rs:23:15
|
23 | match &*answer.to_lowercase().trim() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you would like to reborrow, try removing `&*`: `answer.to_lowercase().trim()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
= note: `#[warn(clippy::borrow_deref_ref)]` on by default
|
unnecessary use of `to_string`:
src/uri.rs#L134
warning: unnecessary use of `to_string`
--> src/uri.rs:134:49
|
134 | query.append_pair("rendezvous", &rendezvous_server.to_string());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `rendezvous_server.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
|
deref which would be done by auto-deref:
src/uri.rs#L128
warning: deref which would be done by auto-deref
--> src/uri.rs:128:22
|
128 | url.set_path(&*val.code);
| ^^^^^^^^^^ help: try this: `&val.code`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
length comparison to zero:
src/transit/crypto.rs#L353
warning: length comparison to zero
--> src/transit/crypto.rs:353:13
|
353 | peer_confirmation_message.len() == 0,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `peer_confirmation_message.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
|
deref which would be done by auto-deref:
src/transit/crypto.rs#L333
warning: deref which would be done by auto-deref
--> src/transit/crypto.rs:333:28
|
333 | handshake.push_psk(&*self.key);
| ^^^^^^^^^^ help: try this: `&self.key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
|
length comparison to zero:
src/transit/crypto.rs#L282
warning: length comparison to zero
--> src/transit/crypto.rs:282:13
|
282 | peer_confirmation_message.len() == 0,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `peer_confirmation_message.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
deref which would be done by auto-deref:
src/transit/crypto.rs#L266
warning: deref which would be done by auto-deref
--> src/transit/crypto.rs:266:28
|
266 | handshake.push_psk(&*self.key);
| ^^^^^^^^^^ help: try this: `&self.key`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeMap`:
src/transfer.rs#L738
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `BTreeMap`
--> src/transfer.rs:738:22
|
738 | .into_iter()
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/transfer.rs#L734
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/transfer.rs:734:28
|
734 | content: f(&base_path),
| ^^^^^^^^^^ help: change this to: `base_path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
useless use of `format!`:
src/transfer/v2.rs#L594
warning: useless use of `format!`
--> src/transfer/v2.rs:594:17
|
594 | format!("Unexpected message: got 'file-start' but did not expect any more files")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Unexpected message: got 'file-start' but did not expect any more files".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
needlessly taken reference of both operands:
src/transfer/v2.rs#L265
warning: needlessly taken reference of both operands
--> src/transfer/v2.rs:265:16
|
265 | if &*our_hash == &sha256[..] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref
= note: `#[warn(clippy::op_ref)]` on by default
help: use the values directly
|
265 | if *our_hash == sha256[..] {
| ~~~~~~~~~ ~~~~~~~~~~
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/transfer/v2.rs#L249
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/transfer/v2.rs:249:39
|
249 | let content = (offer.get_file(&file).unwrap().0)();
| ^^^^^ help: change this to: `file`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
returning the result of a `let` binding from a block:
src/transfer/v2.rs#L214
warning: returning the result of a `let` binding from a block
--> src/transfer/v2.rs:214:9
|
213 | let message = PeerMessageV2::Offer((&offer).into()).ser_msgpack();
| ------------------------------------------------------------------ unnecessary `let` binding
214 | message
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
213 ~
214 ~ PeerMessageV2::Offer((&offer).into()).ser_msgpack()
|
|
useless conversion to the same type: `transit::Hints`:
src/transfer/v2.rs#L121
warning: useless conversion to the same type: `transit::Hints`
--> src/transfer/v2.rs:121:17
|
121 | transit.hints_v2.into()
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `transit.hints_v2`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless conversion to the same type: `transit::Hints`:
src/transfer/v2.rs#L112
warning: useless conversion to the same type: `transit::Hints`
--> src/transfer/v2.rs:112:13
|
112 | (**connector.our_hints()).clone().into(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(**connector.our_hints()).clone()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/transfer/v1.rs#L776
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/transfer/v1.rs:776:35
|
776 | let data = path2bytes(&path);
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this async expression only awaits a single future:
src/transfer/v1.rs#L333
warning: this async expression only awaits a single future
--> src/transfer/v1.rs:333:69
|
333 | let content = futures::stream::iter(content).then(|content| async { content.await });
| ^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `content`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_async_block
= note: `#[warn(clippy::redundant_async_block)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/transfer/v1.rs#L302
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/transfer/v1.rs:302:65
|
302 | let header = tar_helper::create_header_file(&path, size)?;
| ^^^^^ help: change this to: `path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
very complex type used. Consider factoring parts into `type` definitions:
src/transfer/v1.rs#L285
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/transfer/v1.rs:285:14
|
285 | ) -> IoResult<Vec<BoxFuture<'static, IoResult<Box<dyn AsyncRead + Unpin + Send + 'static>>>>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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
|
using `clone` on type `Abilities` which implements the `Copy` trait:
src/forwarding.rs#L155
warning: using `clone` on type `Abilities` which implements the `Copy` trait
--> src/forwarding.rs:155:14
|
155 | Some(peer_version.transit_abilities.clone()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `peer_version.transit_abilities`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
|
using `clone` on type `Abilities` which implements the `Copy` trait:
src/forwarding.rs#L154
warning: using `clone` on type `Abilities` which implements the `Copy` trait
--> src/forwarding.rs:154:9
|
154 | our_version.transit_abilities.clone(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `our_version.transit_abilities`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
|
this `RefCell` reference is held across an `await` point:
src/dilation/mod.rs#L51
warning: this `RefCell` reference is held across an `await` point
--> src/dilation/mod.rs:51:9
|
51 | / self.wormhole
52 | | .borrow_mut()
| |_________________________^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the `await` points this reference is held through
--> src/dilation/mod.rs:50:87
|
50 | async fn send_json(&self, command: &ProtocolCommand) -> Result<(), WormholeError> {
| _______________________________________________________________________________________^
51 | | self.wormhole
52 | | .borrow_mut()
53 | | .send_json_with_phase(command, Phase::dilation)
54 | | .await
55 | | }
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_refcell_ref
|
this `RefCell` reference is held across an `await` point:
src/dilation/mod.rs#L40
warning: this `RefCell` reference is held across an `await` point
--> src/dilation/mod.rs:40:23
|
40 | let message = self.wormhole.borrow_mut().receive_json().await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the `await` points this reference is held through
--> src/dilation/mod.rs:40:9
|
40 | let message = self.wormhole.borrow_mut().receive_json().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
|
returning the result of a `let` binding from a block:
src/dilation/manager.rs#L46
warning: returning the result of a `let` binding from a block
--> src/dilation/manager.rs:46:9
|
41 | / let machine = ManagerMachine {
42 | | side,
43 | | role: Role::Follower,
44 | | state: Some(State::Wanting),
45 | | };
| |__________- unnecessary `let` binding
46 | machine
| ^^^^^^^
|
= 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
|
41 ~
42 ~ ManagerMachine {
43 + side,
44 + role: Role::Follower,
45 + state: Some(State::Wanting),
46 + }
|
|
unnecessary use of `splitn`:
src/core.rs#L726
warning: unnecessary use of `splitn`
--> src/core.rs:726:24
|
726 | Nameplate::new(self.0.splitn(2, '-').next().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `self.0.split('-')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_splitn
= note: `#[warn(clippy::needless_splitn)]` on by default
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/core.rs#L697
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/core.rs:697:1
|
697 | impl Into<String> for Nameplate {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<core::Nameplate>`
|
697 ~ impl From<Nameplate> for String {
698 ~ fn from(val: Nameplate) -> Self {
699 ~ val.0
|
|
`to_string` applied to a type that implements `Display` in `format!` args:
src/core.rs#L663
warning: `to_string` applied to a type that implements `Display` in `format!` args
--> src/core.rs:663:41
|
663 | Phase(format!("dilate-{}", phase.to_string()).to_string().into())
| ^^^^^^^^^^^^ help: remove this
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
= note: `#[warn(clippy::to_string_in_format_args)]` on by default
|
useless conversion to the same type: `core::EitherSide`:
src/core.rs#L646
warning: useless conversion to the same type: `core::EitherSide`
--> src/core.rs:646:19
|
646 | TheirSide(side.0.into())
| ^^^^^^^^^^^^^ help: consider removing `.into()`: `side.0`
|
= 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/core.rs#L472
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core.rs:472:9
|
472 | &self.protocol.our_version()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.protocol.our_version()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded `return` statement:
src/core.rs#L306
warning: unneeded `return` statement
--> src/core.rs:306:9
|
306 | / return Ok((
307 | | WormholeWelcome {
308 | | welcome: mailbox_connection.welcome.clone(),
309 | | code: code,
310 | | },
311 | | Self::connect(mailbox_connection).await?,
312 | | ));
| |__________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
306 ~ Ok((
307 + WormholeWelcome {
308 + welcome: mailbox_connection.welcome.clone(),
309 + code: code,
310 + },
311 + Self::connect(mailbox_connection).await?,
312 ~ ))
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/core.rs#L164
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core.rs:164:42
|
164 | let code = Code::new(&nameplate, &password);
| ^^^^^^^^^ help: change this to: `password`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
unneeded late initialization:
src/core/wordlist.rs#L59
warning: unneeded late initialization
--> src/core/wordlist.rs:59:9
|
59 | let components: Vec<String>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ created here
60 | / components = self
61 | | .words
62 | | .iter()
63 | | .cycle()
64 | | .take(self.num_words)
65 | | .map(|words| words.choose(&mut rng).unwrap().to_string())
66 | | .collect();
| |______________________^ initialised here
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `components` here
|
60 | let components: Vec<String> = self
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
calling `push_str()` using a single-character string literal:
src/core/wordlist.rs#L47
warning: calling `push_str()` using a single-character string literal
--> src/core/wordlist.rs:47:21
|
47 | suffix.push_str("-");
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `suffix.push('-')`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str
= note: `#[warn(clippy::single_char_add_str)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/core/wordlist.rs#L43
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core/wordlist.rs:43:37
|
43 | suffix.push_str(&word);
| ^^^^^ help: change this to: `word`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/core/wordlist.rs#L42
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/core/wordlist.rs:42:37
|
42 | suffix.truncate(p as usize);
| ^^^^^^^^^^ help: try: `p`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/core/wordlist.rs#L39
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core/wordlist.rs:39:37
|
39 | suffix.push_str(&word);
| ^^^^^ help: change this to: `word`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
deref on an immutable reference:
src/core/key.rs#L79
warning: deref on an immutable reference
--> src/core/key.rs:79:33
|
79 | Box::new(derive_key(&*self, purpose.as_bytes())),
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
help: if you would like to reborrow, try removing `&*`
|
79 | Box::new(derive_key(self, purpose.as_bytes())),
| ~~~~
help: if you would like to deref, try using `&**`
|
79 | Box::new(derive_key(&**self, purpose.as_bytes())),
| ~~~~~~~
|
the borrowed expression implements the required traits:
src/core/key.rs#L71
warning: the borrowed expression implements the required traits
--> src/core/key.rs:71:21
|
71 | hex::encode(&**self)
| ^^^^^^^ help: change this to: `**self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
deref on an immutable reference:
src/core/key.rs#L52
warning: deref on an immutable reference
--> src/core/key.rs:52:57
|
52 | let transit_purpose = format!("{}/transit-key", &*appid);
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
= note: `#[warn(clippy::borrow_deref_ref)]` on by default
help: if you would like to reborrow, try removing `&*`
|
52 | let transit_purpose = format!("{}/transit-key", appid);
| ~~~~~
help: if you would like to deref, try using `&**`
|
52 | let transit_purpose = format!("{}/transit-key", &**appid);
| ~~~~~~~~
|
the borrowed expression implements the required traits:
src/util.rs#L22
warning: the borrowed expression implements the required traits
--> src/util.rs:22:38
|
22 | let hex_decode = hex::decode(&self.0);
| ^^^^^^^ help: change this to: `self.0`
|
= 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
|
variants `Waiting` and `Stopping` are never constructed:
src/dilation/manager.rs#L21
warning: variants `Waiting` and `Stopping` are never constructed
--> src/dilation/manager.rs:21:5
|
20 | pub enum State {
| ----- variants in this enum
21 | Waiting,
| ^^^^^^^
...
28 | Stopping,
| ^^^^^^^^
|
= note: `State` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
variant `CloseConnection` is never constructed:
src/dilation/api.rs#L32
warning: variant `CloseConnection` is never constructed
--> src/dilation/api.rs:32:5
|
31 | pub enum IOCommand {
| --------- variant in this enum
32 | CloseConnection,
| ^^^^^^^^^^^^^^^
|
= note: `IOCommand` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
variant `IO` is never constructed:
src/dilation/api.rs#L18
warning: variant `IO` is never constructed
--> src/dilation/api.rs:18:5
|
15 | pub enum ManagerCommand {
| -------------- variant in this enum
...
18 | IO(IOCommand),
| ^^
|
= note: `ManagerCommand` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
|
associated function `add` is never used:
src/core/server_messages.rs#L199
warning: associated function `add` is never used
--> src/core/server_messages.rs:199:12
|
178 | impl OutboundMessage {
| -------------------- associated function in this implementation
...
199 | pub fn add(phase: Phase, body: Vec<u8>) -> Self {
| ^^^
|
variant `Ping` is never constructed:
src/core/server_messages.rs#L173
warning: variant `Ping` is never constructed
--> src/core/server_messages.rs:173:5
|
135 | pub enum OutboundMessage {
| --------------- variant in this enum
...
173 | Ping {
| ^^^^
|
= note: `OutboundMessage` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
this seems like a manual implementation of the non-exhaustive pattern:
src/transit.rs#L580
warning: this seems like a manual implementation of the non-exhaustive pattern
--> src/transit.rs:580:1
|
580 | / pub struct TransitInfo {
581 | | /// Whether we are connected directly or via a relay server
582 | | pub conn_type: ConnectionType,
583 | | /// Target address of our connection. This may be our peer, or the relay server.
... |
588 | | _unused: (),
589 | | }
| |_^
|
help: remove this field
--> src/transit.rs:588:5
|
588 | _unused: (),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
= note: `#[warn(clippy::manual_non_exhaustive)]` on by default
|
this `else { if .. }` block can be collapsed:
src/transfer.rs#L460
warning: this `else { if .. }` block can be collapsed
--> src/transfer.rs:460:16
|
460 | } else {
| ________________^
461 | | if self.is_directory() {
462 | | let count = entry.iter_files().count();
463 | | format!("{name} with {count} files inside")
... |
466 | | }
467 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
460 ~ } else if self.is_directory() {
461 + let count = entry.iter_files().count();
462 + format!("{name} with {count} files inside")
463 + } else {
464 + name.clone()
465 + }
|
|
unnecessary `pub(self)`:
src/transfer/v2.rs#L72
warning: unnecessary `pub(self)`
--> src/transfer/v2.rs:72:1
|
72 | pub(self) struct AnswerMessageInner {
| ^^^^^^^^^ help: remove it
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self
|
redundant field names in struct initialization:
src/core.rs#L309
warning: redundant field names in struct initialization
--> src/core.rs:309:17
|
309 | code: code,
| ^^^^^^^^^^ help: replace it with: `code`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
unnecessary `pub(self)`:
src/core.rs#L13
warning: unnecessary `pub(self)`
--> src/core.rs:13:1
|
13 | pub(self) use self::server_messages::EncryptedMessage;
| ^^^^^^^^^ help: remove it
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self
= note: `#[warn(clippy::needless_pub_self)]` on by default
|
this import is redundant:
src/core.rs#L8
warning: this import is redundant
--> src/core.rs:8:1
|
8 | use serde;
| ^^^^^^^^^^ help: remove it entirely
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
= note: `#[warn(clippy::single_component_path_imports)]` on by default
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L228
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:228:23
|
228 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L203
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:203:15
|
203 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L179
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:179:15
|
179 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L170
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:170:11
|
170 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L158
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:158:15
|
158 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L143
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:143:15
|
143 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L130
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:130:15
|
130 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/transit.rs#L121
warning: unneeded sub `cfg` when there is no condition
--> src/transit.rs:121:11
|
121 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
|
unneeded sub `cfg` when there is no condition:
src/core.rs#L736
warning: unneeded sub `cfg` when there is no condition
--> src/core.rs:736:11
|
736 | #[cfg(all())]
| ^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
= note: `#[warn(clippy::non_minimal_cfg)]` on by default
|