Skip to content

clippy: add safety comment for unwrap calls

Sign in for the full log view
GitHub Actions / clippy failed Mar 24, 2024 in 0s

clippy

2 errors, 2 warnings

Details

Results

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

Versions

  • rustc 1.77.0 (aedd173a2 2024-03-17)
  • cargo 1.77.0 (3fe68eabf 2024-02-29)
  • clippy 0.1.77 (aedd173 2024-03-17)

Annotations

Check warning on line 30 in plugin/src/types.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `let...else` may be rewritten with the `?` operator

warning: this `let...else` may be rewritten with the `?` operator
  --> plugin/src/types.rs:28:9
   |
28 | /         let Some(ref value) = self.value else {
29 | |             return None;
30 | |         };
   | |__________^ help: replace it with: `let ref value = self.value?;`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark
   = note: `#[warn(clippy::question_mark)]` on by default

Check failure on line 279 in plugin/src/plugin.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

error: used `unwrap()` on a `Result` value
   --> plugin/src/plugin.rs:279:25
    |
279 |             let level = LevelFilter::from_str(&level).unwrap();
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: if this value is an `Err`, it will panic
    = help: 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

Check failure on line 84 in plugin/src/plugin.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

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

error: used `unwrap()` on a `Result` value
  --> plugin/src/plugin.rs:84:34
   |
84 |                 writer.write_all(serde_json::to_string(&request).unwrap().as_bytes())
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if this value is an `Err`, it will panic
   = help: 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
  --> plugin/src/lib.rs:10:9
   |
10 | #![deny(clippy::unwrap_used)]
   |         ^^^^^^^^^^^^^^^^^^^

Check warning on line 55 in plugin/src/plugin.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
  --> plugin/src/plugin.rs:55:14
   |
55 |     on_init: Option<Arc<dyn Fn(&mut Plugin<T>) -> Value>>,
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
   = note: `#[warn(clippy::type_complexity)]` on by default