Skip to content

cleanup

cleanup #63

GitHub Actions / clippy succeeded Sep 2, 2023 in 0s

clippy

19 warnings

Details

Results

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

Versions

  • rustc 1.72.0 (5680fa18f 2023-08-23)
  • cargo 1.72.0 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (5680fa1 2023-08-23)

Annotations

Check warning on line 362 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

used `unwrap()` on a `Result` value

warning: used `unwrap()` on a `Result` value
   --> src/lib.rs:362:50
    |
362 |         let (invoke_handler, event_collection) = self.export_inner().unwrap();
    |                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: if you don't want to handle the `Err` case gracefully, consider using `expect()` to provide a better panic message
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
note: the lint level is defined here
   --> src/lib.rs:91:22
    |
91  | #![warn(clippy::all, clippy::unwrap_used, clippy::panic
    |                      ^^^^^^^^^^^^^^^^^^^

Check warning on line 189 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/event.rs:189:21
    |
189 |         window.once(&meta.wrap_with_plugin(Self::NAME), make_handler!(handler))
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `meta.wrap_with_plugin(Self::NAME)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 180 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/event.rs:180:23
    |
180 |         window.listen(&meta.wrap_with_plugin(Self::NAME), make_handler!(handler))
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `meta.wrap_with_plugin(Self::NAME)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 148 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/event.rs:148:28
    |
148 |         handle.once_global(&meta.wrap_with_plugin(Self::NAME), make_handler!(handler))
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `meta.wrap_with_plugin(Self::NAME)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 139 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/event.rs:139:30
    |
139 |         handle.listen_global(&meta.wrap_with_plugin(Self::NAME), make_handler!(handler))
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `meta.wrap_with_plugin(Self::NAME)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 81 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
  --> src/event.rs:81:28
   |
81 |         .unwrap_or_else(|| panic!("Event {name} not found in registry!"))
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic

Check warning on line 54 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
  --> src/event.rs:54:26
   |
54 |     pub fn get_or_manage<'a, R: Runtime>(handle: &'a impl Manager<R>) -> tauri::State<'a, Self> {
   |                          ^^                       ^^                                  ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` implied by `#[warn(clippy::all)]`
help: elide the lifetimes
   |
54 -     pub fn get_or_manage<'a, R: Runtime>(handle: &'a impl Manager<R>) -> tauri::State<'a, Self> {
54 +     pub fn get_or_manage<R: Runtime>(handle: &impl Manager<R>) -> tauri::State<'_, Self> {
   |

Check warning on line 34 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
  --> src/event.rs:34:13
   |
34 |             panic!("Another event with name {} is already registered!", E::NAME)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic

Check warning on line 30 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`panic` should not be present in production code

warning: `panic` should not be present in production code
  --> src/event.rs:30:13
   |
30 |             panic!("Event {} registered twice!", E::NAME)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#panic
note: the lint level is defined here
  --> src/lib.rs:91:43
   |
91 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic
   |                                           ^^^^^^^^^^^^^

Check warning on line 190 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/js.rs:190:51
    |
190 |                 ts::named_datatype(&cfg.inner, v, &type_map).map(|typ| {
    |                                                   ^^^^^^^^^ help: change this to: `type_map`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 184 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/js.rs:184:50
    |
184 |         let events = Self::render_events(events, &type_map, cfg)?;
    |                                                  ^^^^^^^^^ help: change this to: `type_map`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 183 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/js.rs:183:56
    |
183 |         let commands = Self::render_commands(commands, &type_map, cfg)?;
    |                                                        ^^^^^^^^^ help: change this to: `type_map`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 136 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/js.rs:136:38
    |
136 |                     .apply_as_prefix(&event.name, ItemType::Event);
    |                                      ^^^^^^^^^^^ help: change this to: `event.name`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 55 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/js.rs:55:59
   |
55 | ...                   ts::datatype(&cfg.inner, typ, &type_map).map(|typ| {
   |                                                     ^^^^^^^^^ help: change this to: `type_map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 48 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/js.rs:48:58
   |
48 |                         t => ts::datatype(&cfg.inner, t, &type_map)?,
   |                                                          ^^^^^^^^^ help: change this to: `type_map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 45 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/js.rs:45:61
   |
45 | ...                   ts::datatype(&cfg.inner, e, &type_map)?
   |                                                   ^^^^^^^^^ help: change this to: `type_map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 44 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/js.rs:44:61
   |
44 | ...                   ts::datatype(&cfg.inner, t, &type_map)?,
   |                                                   ^^^^^^^^^ help: change this to: `type_map`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`

Check warning on line 35 in src/js.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
  --> src/js.rs:35:14
   |
35 |             .into_iter()
   |              ^^^^^^^^^ help: call directly: `iter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
note: the lint level is defined here
  --> src/lib.rs:91:9
   |
91 | #![warn(clippy::all, clippy::unwrap_used, clippy::panic
   |         ^^^^^^^^^^^
   = note: `#[warn(clippy::into_iter_on_ref)]` implied by `#[warn(clippy::all)]`

Check warning on line 97 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `borrow::Cow`

warning: unused import: `borrow::Cow`
  --> src/lib.rs:97:5
   |
97 |     borrow::Cow,
   |     ^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default