clippy: add safety comment for unwrap calls #580
Annotations
6 errors and 62 warnings
used `unwrap()` on a `Result` value:
plugin/src/plugin.rs#L279
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
|
used `unwrap()` on a `Result` value:
plugin/src/plugin.rs#L84
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)]
| ^^^^^^^^^^^^^^^^^^^
|
used `unwrap()` on a `Result` value:
plugin/src/plugin.rs#L279
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
|
used `unwrap()` on a `Result` value:
plugin/src/plugin.rs#L84
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)]
| ^^^^^^^^^^^^^^^^^^^
|
Lints
could not compile `clightningrpc-plugin` (lib) due to 3 previous errors; 2 warnings emitted
|
Lints
Clippy had exited with the 101 exit code
|
this `let...else` may be rewritten with the `?` operator:
plugin/src/types.rs#L28
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
|
very complex type used. Consider factoring parts into `type` definitions:
plugin/src/plugin.rs#L55
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
|
this `let...else` may be rewritten with the `?` operator:
plugin/src/types.rs#L28
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
|
very complex type used. Consider factoring parts into `type` definitions:
plugin/src/plugin.rs#L55
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
|
Lints
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Lints
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Lints
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lints
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lints
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Lints
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (nightly)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Build (nightly)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build (nightly)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (nightly)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (nightly)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (nightly)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (nightly):
plugin_macros/src/lib.rs#L15
struct `Tracer` is never constructed
|
Build (nightly)
`clightningrpc-plugin-macros` (lib) generated 1 warning
|
Build (nightly):
plugin/src/plugin.rs#L7
the item `String` is imported redundantly
|
Build (nightly):
common/src/errors.rs#L21
the item `serde_json` is imported redundantly
|
Build (nightly)
`clightningrpc-common` (lib) generated 1 warning
|
Build (nightly):
tests/src/lib.rs#L33
the item `async_run` is imported redundantly
|
Build (nightly)
`tests` (lib) generated 1 warning
|
Build (nightly)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (nightly):
tests/src/lib.rs#L33
the item `async_run` is imported redundantly
|
Build (nightly):
common/src/errors.rs#L21
the item `serde_json` is imported redundantly
|
Build (nightly)
`clightningrpc-common` (lib) generated 1 warning
|
Build (nightly):
plugin_macros/src/lib.rs#L15
struct `Tracer` is never constructed
|
Build (nightly):
plugin/src/plugin.rs#L7
the item `String` is imported redundantly
|
Build (nightly)
`clightningrpc-plugin` (lib) generated 1 warning
|
Build (nightly)
`clightningrpc-plugin-macros` (lib) generated 1 warning
|
Build (nightly)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (stable)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Build (stable)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (stable)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (stable)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (stable)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (beta)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
Build (beta)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
Build (beta):
common/src/errors.rs#L21
the item `serde_json` is imported redundantly
|
Build (beta)
`clightningrpc-common` (lib) generated 1 warning
|
Build (beta):
tests/src/lib.rs#L33
the item `async_run` is imported redundantly
|
Build (beta):
plugin/src/plugin.rs#L7
the item `String` is imported redundantly
|
Build (beta):
plugin_macros/src/lib.rs#L15
struct `Tracer` is never constructed
|
Build (beta)
`clightningrpc-plugin` (lib) generated 1 warning
|
Build (beta)
`clightningrpc-plugin-macros` (lib) generated 1 warning
|
Build (beta)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (beta):
plugin_macros/src/lib.rs#L15
struct `Tracer` is never constructed
|
Build (beta)
`clightningrpc-plugin-macros` (lib) generated 1 warning
|
Build (beta):
common/src/errors.rs#L21
the item `serde_json` is imported redundantly
|
Build (beta):
plugin/src/plugin.rs#L7
the item `String` is imported redundantly
|
Build (beta)
`clightningrpc-common` (lib) generated 1 warning
|
Build (beta):
tests/src/lib.rs#L33
the item `async_run` is imported redundantly
|
Build (beta)
`tests` (lib) generated 1 warning
|
Build (beta)
the following packages contain code that will be rejected by a future version of Rust: rstest v0.10.0
|
Build (beta)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (beta)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (beta)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
Build (beta)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|