mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust: Fix cargo clippy false positives
Add allow attributes for intentional patterns in pvverify and pvsecret.
Command line used to get the findings:
$ clippy --all-features -- --cap-lints=warn
...
help: remove this field
--> pvverify/src/cli.rs:22:5
|
22 | version: (),
| ^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
= note: `#[warn(clippy::manual_non_exhaustive)]` on by default
help: use the `#[non_exhaustive]` attribute instead
|
16 + #[non_exhaustive]
17 | pub struct CliOptions {
|
warning: struct `AddSecretOptComb` is never constructed
--> pvsecret/src/cli.rs:313:12
|
313 | pub struct AddSecretOptComb<'a> {
| ^^^^^^^^^^^^^^^^
|
= note: `-W dead-code` implied by `-W unused`
= help: to override `-W unused` add `#[expect(dead_code)]` or `#[allow(dead_code)]`
warning: struct `ListSecretOptComb` is never constructed
--> pvsecret/src/cli.rs:355:12
|
355 | pub struct ListSecretOptComb<'a> {
| ^^^^^^^^^^^^^^^^^
warning: struct `RetrSecretOptionsComb` is never constructed
--> pvsecret/src/cli.rs:490:12
|
490 | pub struct RetrSecretOptionsComb<'a> {
| ^^^^^^^^^^^^^^^^^^^^^
Assisted-by: IBM Bob:1.0.4
Reviewed-by: Timo Keller <tkeller@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
390e48869e
commit
f0a148fd0b
@@ -310,6 +310,9 @@ pub struct AddSecretOpt {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
// Allow dead_code to suppress false positive: struct fields are accessed via From trait
|
||||
// implementation and used in cmd/add.rs, but clippy doesn't detect this indirect usage pattern
|
||||
#[allow(dead_code)]
|
||||
pub struct AddSecretOptComb<'a> {
|
||||
pub input: &'a str,
|
||||
pub force: bool,
|
||||
@@ -352,6 +355,9 @@ pub struct ListSecretOpt {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
// Allow dead_code to suppress false positive: struct fields are accessed via From trait
|
||||
// implementation and used in cmd/list.rs, but clippy doesn't detect this indirect usage pattern
|
||||
#[allow(dead_code)]
|
||||
pub struct ListSecretOptComb<'a> {
|
||||
pub output: &'a str,
|
||||
pub format: ListSecretOutputType,
|
||||
@@ -487,6 +493,9 @@ pub enum RetrOutFmt {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
// Allow dead_code to suppress false positive: struct fields are accessed via From trait
|
||||
// implementation and used in cmd/retr.rs, but clippy doesn't detect this indirect usage pattern
|
||||
#[allow(dead_code)]
|
||||
pub struct RetrSecretOptionsComb<'a> {
|
||||
pub input: &'a str,
|
||||
pub output: &'a str,
|
||||
|
||||
@@ -13,6 +13,9 @@ static VERSION: OnceLock<String> = OnceLock::new();
|
||||
/// Tool to verify host-keys
|
||||
///
|
||||
/// Tool to verify host-keys. Use this tool to verify the chain of trust for IBM Secure
|
||||
// Allow manual_non_exhaustive to suppress Clippy false positive as the version
|
||||
// field is used by Clap to generate the --version flag.
|
||||
#[allow(clippy::manual_non_exhaustive)]
|
||||
pub struct CliOptions {
|
||||
#[command(flatten)]
|
||||
pub certificate_args: CertificateOptions,
|
||||
|
||||
Reference in New Issue
Block a user