Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginUtils #43

Merged
merged 2 commits into from
Aug 31, 2023

plugin only

0fba06e
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

PluginUtils #43

plugin only
0fba06e
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Aug 31, 2023 in 0s

clippy

25 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 25
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 356 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:356:50
    |
356 |         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 185 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:185:21
    |
185 |         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 176 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:176:23
    |
176 |         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 144 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:144:28
    |
144 |         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 135 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:135:30
    |
135 |         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 77 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:77:28
   |
77 |         .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
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 50 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:50:26
   |
50 |     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
   |
50 -     pub fn get_or_manage<'a, R: Runtime>(handle: &'a impl Manager<R>) -> tauri::State<'a, Self> {
50 +     pub fn get_or_manage<R: Runtime>(handle: &impl Manager<R>) -> tauri::State<'_, Self> {
   |

Check warning on line 44 in src/event.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `PluginName`

warning: useless conversion to the same type: `PluginName`
  --> src/event.rs:44:34
   |
44 |                     plugin_name: PluginName::from(plugin_name),
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `PluginName::from()`: `plugin_name`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
   = note: `#[warn(clippy::useless_conversion)]` implied by `#[warn(clippy::all)]`

Check warning on line 171 in src/ts.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/ts.rs:171:63
    |
171 |             .map(|v| ts::export_named_datatype(&cfg.inner, v, &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 166 in src/ts.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/ts.rs:166:50
    |
166 |         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 165 in src/ts.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/ts.rs:165:56
    |
165 |         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 59 in src/ts.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/ts.rs:59:57
   |
59 | ...                   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 50 in src/ts.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/ts.rs:50:54
   |
50 |                     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 48 in src/ts.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/ts.rs:48:53
   |
48 |                         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 38 in src/ts.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/ts.rs:38:55
   |
38 |                         ts::datatype(&cfg.inner, typ, &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 28 in src/ts.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/ts.rs:28:14
   |
28 |             .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

Check warning on line 185 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:185:51
    |
185 |                 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 179 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:179:50
    |
179 |         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 178 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:178:56
    |
178 |         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 131 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:131:38
    |
131 |                     .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 50 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:50:59
   |
50 | ...                   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 43 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:43:58
   |
43 |                         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 40 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:40:61
   |
40 | ...                   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 39 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:39:61
   |
39 | ...                   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 30 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:30:14
   |
30 |             .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)]`