feat(local): redir *bsd pfvar.h bindgen #858
Annotations
8 errors and 23 warnings
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L268
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:268:25
|
268 | mem::size_of::<in_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
= note: `#[deny(clippy::size_of_in_element_count)]` on by default
|
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L276
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:276:25
|
276 | mem::size_of::<in6_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
|
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L288
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:288:25
|
288 | mem::size_of::<in_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
|
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L296
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:296:25
|
296 | mem::size_of::<in6_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
|
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L339
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:339:41
|
339 | ... mem::size_of::<in_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
|
found a count of bytes instead of a count of elements of `T`:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L357
error: found a count of bytes instead of a count of elements of `T`
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:357:41
|
357 | ... mem::size_of::<in6_addr>(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use a count of elements instead of a count of bytes, it already gets multiplied by the size of the type
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
|
clippy-check (macos-latest)
Clippy had exited with the 101 exit code
|
clippy-check (windows-latest)
The operation was canceled.
|
clippy-check (ubuntu-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
the borrowed expression implements the required traits:
crates/shadowsocks/src/config.rs#L636
warning: the borrowed expression implements the required traits
--> crates/shadowsocks/src/config.rs:636:55
|
636 | URL_PASSWORD_BASE64_ENGINE.encode(&user_info)
| ^^^^^^^^^^ help: change this to: `user_info`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
useless conversion to the same type: `std::result::Result<usize, std::io::Error>`:
crates/shadowsocks/src/net/udp.rs#L207
warning: useless conversion to the same type: `std::result::Result<usize, std::io::Error>`
--> crates/shadowsocks/src/net/udp.rs:207:24
|
207 | return Err(make_mtu_error(buf.len(), mtu)).into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `Err(make_mtu_error(buf.len(), mtu))`
|
= 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
|
useless conversion to the same type: `std::result::Result<usize, std::io::Error>`:
crates/shadowsocks/src/net/udp.rs#L232
warning: useless conversion to the same type: `std::result::Result<usize, std::io::Error>`
--> crates/shadowsocks/src/net/udp.rs:232:24
|
232 | return Err(make_mtu_error(buf.len(), mtu)).into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `Err(make_mtu_error(buf.len(), mtu))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
unused import: `self::unix::*`:
crates/shadowsocks-service/src/local/redir/sys/mod.rs#L9
warning: unused import: `self::unix::*`
--> crates/shadowsocks-service/src/local/redir/sys/mod.rs:9:17
|
9 | pub use self::unix::*;
| ^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
unused import: `self::linux::*`:
crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs#L6
warning: unused import: `self::linux::*`
--> crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs:6:17
|
6 | pub use self::linux::*;
| ^^^^^^^^^^^^^^
|
unused import: `self::unix::*`:
crates/shadowsocks-service/src/local/redir/tcprelay/sys/mod.rs#L6
warning: unused import: `self::unix::*`
--> crates/shadowsocks-service/src/local/redir/tcprelay/sys/mod.rs:6:17
|
6 | pub use self::unix::*;
| ^^^^^^^^^^^^^
|
very complex type used. Consider factoring parts into `type` definitions:
crates/shadowsocks-service/src/local/http/http_client.rs#L42
warning: very complex type used. Consider factoring parts into `type` definitions
--> crates/shadowsocks-service/src/local/http/http_client.rs:42:17
|
42 | cache_conn: Arc<Mutex<LruCache<Address, VecDeque<(HttpConnection, Instant)>>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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:
crates/shadowsocks-service/src/local/http/http_client.rs#L99
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/shadowsocks-service/src/local/http/http_client.rs:99:63
|
99 | if let Some(q) = self.cache_conn.lock().await.get_mut(&host) {
| ^^^^^ help: change this to: `host`
|
= 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
|
file opened with `create`, but `truncate` behavior not defined:
crates/shadowsocks-service/src/manager/server.rs#L420
warning: file opened with `create`, but `truncate` behavior not defined
--> crates/shadowsocks-service/src/manager/server.rs:420:46
|
420 | match OpenOptions::new().write(true).create(true).open(&config_file_path) {
| ^^^^^^^^^^^^- help: add: `.truncate(true)`
|
= help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
= help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
= help: alternatively, use `.append(true)` to append to the file instead of overwriting it
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
= note: `#[warn(clippy::suspicious_open_options)]` on by default
|
this OR pattern can be rewritten using a range:
src/logging/mod.rs#L58
warning: this OR pattern can be rewritten using a range
--> src/logging/mod.rs:58:9
|
58 | 0 | 1 | 2 | 3 => logging_builder
| ^^^^^^^^^^^^^ help: try: `0..=3`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
= note: `#[warn(clippy::manual_range_patterns)]` on by default
|
clippy-check (macos-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
the borrowed expression implements the required traits:
crates/shadowsocks/src/config.rs#L636
warning: the borrowed expression implements the required traits
--> crates/shadowsocks/src/config.rs:636:55
|
636 | URL_PASSWORD_BASE64_ENGINE.encode(&user_info)
| ^^^^^^^^^^ help: change this to: `user_info`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
useless conversion to the same type: `std::result::Result<usize, std::io::Error>`:
crates/shadowsocks/src/net/udp.rs#L207
warning: useless conversion to the same type: `std::result::Result<usize, std::io::Error>`
--> crates/shadowsocks/src/net/udp.rs:207:24
|
207 | return Err(make_mtu_error(buf.len(), mtu)).into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `Err(make_mtu_error(buf.len(), mtu))`
|
= 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
|
useless conversion to the same type: `std::result::Result<usize, std::io::Error>`:
crates/shadowsocks/src/net/udp.rs#L232
warning: useless conversion to the same type: `std::result::Result<usize, std::io::Error>`
--> crates/shadowsocks/src/net/udp.rs:232:24
|
232 | return Err(make_mtu_error(buf.len(), mtu)).into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `Err(make_mtu_error(buf.len(), mtu))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
unused import: `self::bsd::*`:
crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs#L11
warning: unused import: `self::bsd::*`
--> crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/mod.rs:11:17
|
11 | pub use self::bsd::*;
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
unused import: `self::unix::*`:
crates/shadowsocks-service/src/local/redir/tcprelay/sys/mod.rs#L6
warning: unused import: `self::unix::*`
--> crates/shadowsocks-service/src/local/redir/tcprelay/sys/mod.rs:6:17
|
6 | pub use self::unix::*;
| ^^^^^^^^^^^^^
|
very complex type used. Consider factoring parts into `type` definitions:
crates/shadowsocks-service/src/local/http/http_client.rs#L42
warning: very complex type used. Consider factoring parts into `type` definitions
--> crates/shadowsocks-service/src/local/http/http_client.rs:42:17
|
42 | cache_conn: Arc<Mutex<LruCache<Address, VecDeque<(HttpConnection, Instant)>>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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:
crates/shadowsocks-service/src/local/http/http_client.rs#L99
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> crates/shadowsocks-service/src/local/http/http_client.rs:99:63
|
99 | if let Some(q) = self.cache_conn.lock().await.get_mut(&host) {
| ^^^^^ help: change this to: `host`
|
= 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
|
unneeded `return` statement:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L56
warning: unneeded `return` statement
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:56:18
|
56 | _ => return Err(io::ErrorKind::InvalidInput.into()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 | _ => Err(io::ErrorKind::InvalidInput.into()),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
this expression borrows a value the compiler would automatically borrow:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L266
warning: this expression borrows a value the compiler would automatically borrow
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:266:39
|
266 | ptr::addr_of!((&*sockaddr).sin_addr),
| ^^^^^^^^^^^^ help: change this to: `(*sockaddr)`
|
= 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:
crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs#L274
warning: this expression borrows a value the compiler would automatically borrow
--> crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:274:39
|
274 | ptr::addr_of!((&*sockaddr).sin6_addr),
| ^^^^^^^^^^^^ help: change this to: `(*sockaddr)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
clippy-check (windows-latest)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|