chore(shadowsocks): clippy suggestions #389
Annotations
4 warnings
transmute used without annotations:
crates/shadowsocks-service/src/local/tun/tcp.rs#L172
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
|
redundant pattern matching, consider using `is_none()`:
crates/shadowsocks/src/net/sys/mod.rs#L198
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
|
transmute used without annotations:
crates/shadowsocks-service/src/local/tun/tcp.rs#L172
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
|
redundant pattern matching, consider using `is_none()`:
crates/shadowsocks/src/net/sys/mod.rs#L198
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
|