Skip to content

Merge pull request #32 from JerryZhongJ/fix-exit-panic #111

Merge pull request #32 from JerryZhongJ/fix-exit-panic

Merge pull request #32 from JerryZhongJ/fix-exit-panic #111

GitHub Actions / clippy succeeded Apr 2, 2024 in 0s

clippy

17 warnings

Details

Results

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

Versions

  • rustc 1.79.0-nightly (1684a753d 2024-04-01)
  • cargo 1.79.0-nightly (a59aba136 2024-03-28)
  • clippy 0.1.79 (1684a75 2024-04-01)

Annotations

Check warning on line 47 in clashctl/src/ui/utils/ticks_counter.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `self.inner.get(0)`

warning: accessing first element with `self.inner.get(0)`
  --> clashctl/src/ui/utils/ticks_counter.rs:47:21
   |
47 |                 / ((self.inner.get(0)?
   |                     ^^^^^^^^^^^^^^^^^ help: try: `self.inner.front()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 94 in clashctl/src/ui/pages/status.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

explicit call to `.into_iter()` in function argument accepting `IntoIterator`

warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
  --> clashctl/src/ui/pages/status.rs:94:20
   |
94 |             .chain(tails.into_iter())
   |                    ^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `tails`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
  --> /rustc/1684a753dbca5d23b2e03568e6fbbb48eb72d0e6/library/core/src/iter/traits/iterator.rs:483:12
   = 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

Check warning on line 20 in clashctl/src/ui/components/proxy/item.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `proxy.history.get(0)`

warning: accessing first element with `proxy.history.get(0)`
  --> clashctl/src/ui/components/proxy/item.rs:20:22
   |
20 |             history: proxy.history.get(0).cloned(),
   |                      ^^^^^^^^^^^^^^^^^^^^ help: try: `proxy.history.first()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 72 in clashctl/src/interactive/sort/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> clashctl/src/interactive/sort/mod.rs:68:1
   |
68 | / impl ToString for Noop {
69 | |     fn to_string(&self) -> String {
70 | |         "".into()
71 | |     }
72 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 125 in clashctl/src/interactive/sort/rule_sort.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> clashctl/src/interactive/sort/rule_sort.rs:114:1
    |
114 | / impl ToString for RuleSort {
115 | |     fn to_string(&self) -> String {
116 | |         format!(
117 | |             "{} {}",
...   |
124 | |     }
125 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl

Check warning on line 191 in clashctl/src/interactive/sort/proxy_sort.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `b.1.history.get(0)`

warning: accessing first element with `b.1.history.get(0)`
   --> clashctl/src/interactive/sort/proxy_sort.rs:191:62
    |
191 |             ProxySortBy::Delay => match (a.1.history.get(0), b.1.history.get(0)) {
    |                                                              ^^^^^^^^^^^^^^^^^^ help: try: `b.1.history.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 191 in clashctl/src/interactive/sort/proxy_sort.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `a.1.history.get(0)`

warning: accessing first element with `a.1.history.get(0)`
   --> clashctl/src/interactive/sort/proxy_sort.rs:191:42
    |
191 |             ProxySortBy::Delay => match (a.1.history.get(0), b.1.history.get(0)) {
    |                                          ^^^^^^^^^^^^^^^^^^ help: try: `a.1.history.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 178 in clashctl/src/interactive/sort/proxy_sort.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
   --> clashctl/src/interactive/sort/proxy_sort.rs:167:1
    |
167 | / impl ToString for ProxySort {
168 | |     fn to_string(&self) -> String {
169 | |         format!(
170 | |             "{} {}",
...   |
177 | |     }
178 | | }
    | |_^
    |
    = help: prefer implementing `Display` instead
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
    = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 112 in clashctl/src/proxy_render.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `history.get(0)`

warning: accessing first element with `history.get(0)`
   --> clashctl/src/proxy_render.rs:111:29
    |
111 |                   let delay = history
    |  _____________________________^
112 | |                     .get(0)
    | |___________________________^ help: try: `history.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first

Check warning on line 62 in clashctl/src/proxy_render.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

accessing first element with `proxy .history.get(0)`

warning: accessing first element with `proxy
                         .history.get(0)`
  --> clashctl/src/proxy_render.rs:60:25
   |
60 |               let delay = proxy
   |  _________________________^
61 | |                 .history
62 | |                 .get(0)
   | |_______________________^
   |
   = 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
help: try
   |
60 ~             let delay = proxy
61 +                 .history.first()
   |

Check warning on line 7 in clashctl/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

private item shadows public glob re-export

warning: private item shadows public glob re-export
 --> clashctl/src/main.rs:7:32
  |
7 | use crate::{clap::Parser, Cmd, Opts};
  |                                ^^^^
  |
note: the name `Opts` in the type namespace is supposed to be publicly re-exported here
 --> clashctl/src/main.rs:1:1
  |
1 | mod_use::mod_use![command, proxy_render, utils, error, interactive, ui];
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but the private item here shadows it
 --> clashctl/src/main.rs:7:32
  |
7 | use crate::{clap::Parser, Cmd, Opts};
  |                                ^^^^
  = note: this warning originates in the macro `mod_use::mod_use` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 7 in clashctl/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the item `Cmd` is imported redundantly

warning: the item `Cmd` is imported redundantly
 --> clashctl/src/main.rs:7:27
  |
1 | mod_use::mod_use![command, proxy_render, utils, error, interactive, ui];
  | ----------------------------------------------------------------------- the item `Cmd` is already imported here
...
7 | use crate::{clap::Parser, Cmd, Opts};
  |                           ^^^

Check warning on line 7 in clashctl/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

private item shadows public glob re-export

warning: private item shadows public glob re-export
 --> clashctl/src/main.rs:7:27
  |
7 | use crate::{clap::Parser, Cmd, Opts};
  |                           ^^^
  |
note: the name `Cmd` in the type namespace is supposed to be publicly re-exported here
 --> clashctl/src/main.rs:1:1
  |
1 | mod_use::mod_use![command, proxy_render, utils, error, interactive, ui];
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but the private item here shadows it
 --> clashctl/src/main.rs:7:27
  |
7 | use crate::{clap::Parser, Cmd, Opts};
  |                           ^^^
  = note: this warning originates in the macro `mod_use::mod_use` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 5 in clashctl/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the item `main_loop` is imported redundantly

warning: the item `main_loop` is imported redundantly
 --> clashctl/src/main.rs:5:5
  |
1 | mod_use::mod_use![command, proxy_render, utils, error, interactive, ui];
  | ----------------------------------------------------------------------- the item `main_loop` is already imported here
...
5 | use ui::main_loop;
  |     ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Check warning on line 5 in clashctl/src/main.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

private item shadows public glob re-export

warning: private item shadows public glob re-export
 --> clashctl/src/main.rs:5:5
  |
5 | use ui::main_loop;
  |     ^^^^^^^^^^^^^
  |
note: the name `main_loop` in the value namespace is supposed to be publicly re-exported here
 --> clashctl/src/main.rs:1:1
  |
1 | mod_use::mod_use![command, proxy_render, utils, error, interactive, ui];
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but the private item here shadows it
 --> clashctl/src/main.rs:5:5
  |
5 | use ui::main_loop;
  |     ^^^^^^^^^^^^^
  = note: `#[warn(hidden_glob_reexports)]` on by default
  = note: this warning originates in the macro `mod_use::mod_use` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 60 in clashctl-core/src/model/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

direct implementation of `ToString`

warning: direct implementation of `ToString`
  --> clashctl-core/src/model/mod.rs:52:1
   |
52 | / impl ToString for VersionPayload {
53 | |     fn to_string(&self) -> String {
54 | |         match self {
55 | |             #[cfg(feature = "deserialize")]
...  |
59 | |     }
60 | | }
   | |_^
   |
   = help: prefer implementing `Display` instead
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
   = note: `#[warn(clippy::to_string_trait_impl)]` on by default

Check warning on line 58 in clashctl-core/src/model/connection.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `deserialize::*`

warning: unused import: `deserialize::*`
  --> clashctl-core/src/model/connection.rs:58:9
   |
58 | pub use deserialize::*;
   |         ^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default