Skip to content

fix(local-online-build): fixed build with default features #1108

fix(local-online-build): fixed build with default features

fix(local-online-build): fixed build with default features #1108

GitHub Actions / clippy macos-latest succeeded Jun 11, 2024 in 0s

clippy macos-latest

5 warnings

Details

Results

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

Versions

  • rustc 1.78.0 (9b00956e5 2024-04-29)
  • cargo 1.78.0 (54d8815d0 2024-03-26)
  • clippy 0.1.78 (9b00956e 2024-04-29)

Annotations

Check warning on line 186 in crates/shadowsocks-service/src/local/online_config/mod.rs

See this annotation in the file changed.

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

useless conversion to the same type: `std::io::Error`

warning: useless conversion to the same type: `std::io::Error`
   --> crates/shadowsocks-service/src/local/online_config/mod.rs:186:24
    |
186 |             return Err(io::Error::new(io::ErrorKind::Other, err).into());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `io::Error::new(io::ErrorKind::Other, err)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 177 in crates/shadowsocks-service/src/local/online_config/mod.rs

See this annotation in the file changed.

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

useless conversion to the same type: `std::io::Error`

warning: useless conversion to the same type: `std::io::Error`
   --> crates/shadowsocks-service/src/local/online_config/mod.rs:177:28
    |
177 |                 return Err(io::Error::new(io::ErrorKind::Other, err).into());
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `io::Error::new(io::ErrorKind::Other, err)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 167 in crates/shadowsocks-service/src/local/online_config/mod.rs

See this annotation in the file changed.

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

useless conversion to the same type: `std::io::Error`

warning: useless conversion to the same type: `std::io::Error`
   --> crates/shadowsocks-service/src/local/online_config/mod.rs:167:35
    |
167 |             Err(..) => return Err(io::Error::new(io::ErrorKind::Other, "body contains non-utf8 bytes").into()),
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `io::Error::new(io::ErrorKind::Other, "body contains non-utf8 bytes")`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

Check warning on line 119 in crates/shadowsocks-service/src/local/http/http_client.rs

See this annotation in the file changed.

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

you should consider adding a `Default` implementation for `HttpClient<B>`

warning: you should consider adding a `Default` implementation for `HttpClient<B>`
   --> crates/shadowsocks-service/src/local/http/http_client.rs:115:5
    |
115 | /     pub fn new() -> HttpClient<B> {
116 | |         HttpClient {
117 | |             cache_conn: Arc::new(Mutex::new(LruCache::with_expiry_duration(CONNECTION_EXPIRE_DURATION))),
118 | |         }
119 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
    = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
    |
108 + impl<B> Default for HttpClient<B>
109 + where
110 +     B: Body + Send + Unpin + Debug + 'static,
111 +     B::Data: Send,
112 +     B::Error: Into<Box<dyn ::std::error::Error + Send + Sync>>,
113 +  {
114 +     fn default() -> Self {
115 +         Self::new()
116 +     }
117 + }
    |

Check warning on line 67 in crates/shadowsocks-service/src/local/http/http_client.rs

See this annotation in the file changed.

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

useless conversion to the same type: `std::time::Instant`

warning: useless conversion to the same type: `std::time::Instant`
  --> crates/shadowsocks-service/src/local/http/http_client.rs:67:25
   |
67 |             sleep.reset(new_deadline.into())
   |                         ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `new_deadline`
   |
   = 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