Add cargo-test runner for macos x86-64 #207
Triggered via pull request
June 13, 2024 13:42
AliceOrunitia
synchronize
#348
Status
Success
Total duration
14s
Artifacts
–
Annotations
26 warnings
check
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: z0al/dependent-issues@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
unused import: `secret_policy_use_only_malloc_secrets`:
rosenpass/src/cli.rs#L7
warning: unused import: `secret_policy_use_only_malloc_secrets`
--> rosenpass/src/cli.rs:7:42
|
7 | secret_policy_try_use_memfd_secrets, secret_policy_use_only_malloc_secrets,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
casting to the same type is unnecessary (`usize` -> `usize`):
wireguard-broker/src/bin/socket_handler.rs#L166
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> wireguard-broker/src/bin/socket_handler.rs:166:24
|
166 | req_buf.resize(len as usize, 0);
| ^^^^^^^^^^^^ help: try: `len`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`usize` -> `usize`):
wireguard-broker/src/bin/socket_handler.rs#L124
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> wireguard-broker/src/bin/socket_handler.rs:124:24
|
124 | res_buf.resize(len as usize, 0);
| ^^^^^^^^^^^^ help: try: `len`
|
= 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:
wireguard-broker/src/bin/priviledged.rs#L63
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> wireguard-broker/src/bin/priviledged.rs:63:30
|
63 | stdout.write_all(&res)?;
| ^^^^ help: change this to: `res`
|
= 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
wireguard-broker/src/brokers/netlink.rs#L104
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> wireguard-broker/src/brokers/netlink.rs:104:39
|
104 | set_peer.preshared_key = Some(&config.psk.secret());
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `config.psk.secret()`
|
= 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:
wireguard-broker/src/brokers/netlink.rs#L100
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> wireguard-broker/src/brokers/netlink.rs:100:71
|
100 | let mut set_peer = wireguard_uapi::set::Peer::from_public_key(&config.peer_id);
| ^^^^^^^^^^^^^^^ help: change this to: `config.peer_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
needlessly taken reference of both operands:
wireguard-broker/src/brokers/netlink.rs#L93
warning: needlessly taken reference of both operands
--> wireguard-broker/src/brokers/netlink.rs:93:23
|
93 | .find(|p| &p.public_key == &config.peer_id.value)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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
|
93 | .find(|p| p.public_key == config.peer_id.value)
| ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
|
called `is_none()` after searching an `Iterator` with `find`:
wireguard-broker/src/brokers/netlink.rs#L90
warning: called `is_none()` after searching an `Iterator` with `find`
--> wireguard-broker/src/brokers/netlink.rs:90:12
|
90 | if state
| ____________^
91 | | .peers
92 | | .iter()
93 | | .find(|p| &p.public_key == &config.peer_id.value)
94 | | .is_none()
| |______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
= note: `#[warn(clippy::search_is_some)]` on by default
help: consider using
|
90 ~ if !state
91 + .peers
92 + .iter().any(|p| &p.public_key == &config.peer_id.value)
|
|
unneeded `return` statement:
wireguard-broker/src/brokers/mio_client.rs#L258
warning: unneeded `return` statement
--> wireguard-broker/src/brokers/mio_client.rs:258:5
|
258 | return Ok(off);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
258 - return Ok(off);
258 + Ok(off)
|
|
unneeded `return` statement:
wireguard-broker/src/brokers/mio_client.rs#L234
warning: unneeded `return` statement
--> wireguard-broker/src/brokers/mio_client.rs:234:5
|
234 | return Ok(off);
| ^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
234 - return Ok(off);
234 + Ok(off)
|
|
this expression borrows a value the compiler would automatically borrow:
wireguard-broker/src/brokers/mio_client.rs#L207
warning: this expression borrows a value the compiler would automatically borrow
--> wireguard-broker/src/brokers/mio_client.rs:207:30
|
207 | self.send_buf.extend((&buf[off..]).iter());
| ^^^^^^^^^^^^^ help: change this to: `buf[off..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression borrows a value the compiler would automatically borrow:
wireguard-broker/src/brokers/mio_client.rs#L195
warning: this expression borrows a value the compiler would automatically borrow
--> wireguard-broker/src/brokers/mio_client.rs:195:9
|
195 | (&self.socket).try_io(|| (&self.socket).flush())?;
| ^^^^^^^^^^^^^^ help: change this to: `self.socket`
|
= 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:
wireguard-broker/src/brokers/mio_client.rs#L118
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> wireguard-broker/src/brokers/mio_client.rs:118:29
|
118 | self.send_or_buffer(&buf)?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
wireguard-broker/src/brokers/mio_client.rs#L71
warning: the following explicit lifetimes could be elided: 'a
--> wireguard-broker/src/brokers/mio_client.rs:71:16
|
71 | fn set_psk<'a>(&mut self, config: SerializedBrokerConfig<'a>) -> anyhow::Result<()> {
| ^^ ^^
|
= 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
|
71 - fn set_psk<'a>(&mut self, config: SerializedBrokerConfig<'a>) -> anyhow::Result<()> {
71 + fn set_psk(&mut self, config: SerializedBrokerConfig<'_>) -> anyhow::Result<()> {
|
|
unneeded `return` statement:
wireguard-broker/src/brokers/mio_client.rs#L59
warning: unneeded `return` statement
--> wireguard-broker/src/brokers/mio_client.rs:59:17
|
59 | return Err(e);
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
59 ~ Err(e)
60 | }
...
63 | }
64 ~ }
|
|
unneeded `return` statement:
wireguard-broker/src/brokers/mio_client.rs#L56
warning: unneeded `return` statement
--> wireguard-broker/src/brokers/mio_client.rs:56:17
|
56 | return Ok(res);
| ^^^^^^^^^^^^^^
|
= 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`
|
56 ~ Ok(res)
57 | }
...
63 | }
64 ~ }
|
|
accessing first element with `req.get(0)`:
wireguard-broker/src/api/server.rs#L52
warning: accessing first element with `req.get(0)`
--> wireguard-broker/src/api/server.rs:52:19
|
52 | let typ = req.get(0).ok_or(InvalidMessage)?;
| ^^^^^^^^^^ help: try: `req.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
this expression borrows a value the compiler would automatically borrow:
wireguard-broker/src/api/msgs.rs#L46
warning: this expression borrows a value the compiler would automatically borrow
--> wireguard-broker/src/api/msgs.rs:46:9
|
46 | (&mut self.iface_buf[..iface.len()]).copy_from_slice(iface);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.iface_buf[..iface.len()]`
|
= 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
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
wireguard-broker/src/api/config.rs#L14
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> wireguard-broker/src/api/config.rs:14:1
|
14 | impl<'a> Into<SerializedBrokerConfig<'a>> for NetworkBrokerConfig<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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<api::config::NetworkBrokerConfig<'a>>`
|
14 ~ impl<'a> From<NetworkBrokerConfig<'a>> for SerializedBrokerConfig<'a> {
15 ~ fn from(val: NetworkBrokerConfig<'a>) -> Self {
16 | SerializedBrokerConfig {
17 ~ interface: val.iface.as_bytes(),
18 ~ peer_id: val.peer_id,
19 ~ psk: val.psk,
|
|
redundant closure:
wireguard-broker/src/api/client.rs#L116
warning: redundant closure
--> wireguard-broker/src/api/client.rs:116:37
|
116 | let config = config.map_err(|e| BrokerClientSetPskError::BrokerError(e))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `BrokerClientSetPskError::BrokerError`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
accessing first element with `res.get(0)`:
wireguard-broker/src/api/client.rs#L91
warning: accessing first element with `res.get(0)`
--> wireguard-broker/src/api/client.rs:91:19
|
91 | let typ = res.get(0).ok_or(invalid_msg_poller())?;
| ^^^^^^^^^^ help: try: `res.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
|
fields `0`, `1`, and `2` are never read:
util/src/typenum.rs#L31
warning: fields `0`, `1`, and `2` are never read
--> util/src/typenum.rs:31:58
|
31 | struct ConstAdd<T, Lhs: IntoConst<T>, Rhs: IntoConst<T>>(*const T, *const Lhs, *const Rhs); // impl IntoConst<T>
| -------- fields in this struct ^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^
|
help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
|
31 | struct ConstAdd<T, Lhs: IntoConst<T>, Rhs: IntoConst<T>>((), (), ()); // impl IntoConst<T>
| ~~ ~~ ~~
|
fields `0` and `1` are never read:
util/src/typenum.rs#L30
warning: fields `0` and `1` are never read
--> util/src/typenum.rs:30:62
|
30 | struct ConstLshift<T, Param: IntoConst<T>, const SHIFT: i32>(*const T, *const Param); // impl IntoConst<T>
| ----------- fields in this struct ^^^^^^^^ ^^^^^^^^^^^^
|
help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
|
30 | struct ConstLshift<T, Param: IntoConst<T>, const SHIFT: i32>((), ()); // impl IntoConst<T>
| ~~ ~~
|
fields `0` and `1` are never read:
util/src/typenum.rs#L27
warning: fields `0` and `1` are never read
--> util/src/typenum.rs:27:5
|
26 | struct ConstApplyPosSign<T: AssociatedUnsigned, Param: IntoConst<<T as AssociatedUnsigned>::Type>>(
| ----------------- fields in this struct
27 | *const T,
| ^^^^^^^^
28 | *const Param,
| ^^^^^^^^^^^^
|
help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
|
27 ~ (),
28 ~ (),
|
|
fields `0` and `1` are never read:
util/src/typenum.rs#L23
warning: fields `0` and `1` are never read
--> util/src/typenum.rs:23:5
|
22 | struct ConstApplyNegSign<T: AssociatedUnsigned, Param: IntoConst<<T as AssociatedUnsigned>::Type>>(
| ----------------- fields in this struct
23 | *const T,
| ^^^^^^^^
24 | *const Param,
| ^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
|
23 ~ (),
24 ~ (),
|
|