Skip to content

chore(shadowsocks): clippy suggestions

Sign in for the full log view
GitHub Actions / clippy macos-latest succeeded Jun 16, 2024 in 0s

clippy macos-latest

2 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 2
Note 0
Help 0

Versions

  • rustc 1.79.0 (129f3b996 2024-06-10)
  • cargo 1.79.0 (ffa9cf99a 2024-06-03)
  • clippy 0.1.79 (129f3b99 2024-06-10)

Annotations

Check warning on line 172 in crates/shadowsocks-service/src/local/tun/tcp.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macos-latest

transmute used without annotations

warning: transmute used without annotations
   --> crates/shadowsocks-service/src/local/tun/tcp.rs:172:38
    |
172 |         let recv_buf = unsafe { mem::transmute::<_, &mut [u8]>(buf.unfilled_mut()) };
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider adding missing annotations: `transmute::<&mut [std::mem::MaybeUninit<u8>], &mut [u8]>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
    = note: `#[warn(clippy::missing_transmute_annotations)]` on by default

Check warning on line 198 in crates/shadowsocks/src/net/sys/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy macos-latest

redundant pattern matching, consider using `is_none()`

warning: redundant pattern matching, consider using `is_none()`
   --> crates/shadowsocks/src/net/sys/mod.rs:198:24
    |
198 |                 if let None = v6.ip().to_ipv4_mapped() {
    |                 -------^^^^--------------------------- help: try: `if v6.ip().to_ipv4_mapped().is_none()`
    |
    = 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