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

Fixest lint errors for the 7.x.y branch. #547

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

Superhepper
Copy link
Collaborator

This commit addresses most of the problems
reported by the Clippy lint tool when building
with rust version 1.80 for the code in the 7.x.y
branch.

wiktor-k
wiktor-k previously approved these changes Sep 23, 2024
Copy link
Collaborator

@wiktor-k wiktor-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks straightforward, thanks!

Btw, as for std::mem::size_of in cryptoki it was apparently solved with an import: https://github.com/parallaxsecond/rust-cryptoki/pull/222/files

@Superhepper
Copy link
Collaborator Author

Superhepper commented Sep 23, 2024

Looks straightforward, thanks!

Btw, as for std::mem::size_of in cryptoki it was apparently solved with an import: https://github.com/parallaxsecond/rust-cryptoki/pull/222/files

Hrrm. Will this not just result in another warning that import us unnecessary?

If not then I will probably change it in this crate as well.

@wiktor-k
Copy link
Collaborator

I just checked and it seems it doesn't:

cryptoki$ git grep mem::siz
src/mechanism/mod.rs:17:use std::mem::size_of;
src/object.rs:14:use std::mem::size_of;
cryptoki$ cargo clippy
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
cryptoki$ cargo build
   Compiling cryptoki-sys v0.1.8 (/home/wiktor/src/open-source/cryptoki/cryptoki-sys)
   Compiling cfg-if v1.0.0
   Compiling zeroize v1.7.0
   Compiling log v0.4.20
   Compiling bitflags v1.3.2
   Compiling libloading v0.7.4
   Compiling secrecy v0.8.0
   Compiling cryptoki v0.7.0 (/home/wiktor/src/open-source/cryptoki/cryptoki)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.93s
cryptoki$ git grep unused
src/lib.rs:38:       unused,
src/lib.rs:39:       unused_allocation,
src/lib.rs:40:       unused_comparisons,
src/lib.rs:41:       unused_parens,
src/lib.rs:49:       unused_extern_crates,
src/lib.rs:50:       unused_import_braces,
src/lib.rs:51:       unused_qualifications,  // <---- it's here
src/lib.rs:52:       unused_results)]
rust-tss-esapi$ git grep unused_qua
tss-esapi/src/lib.rs:27:    unused_qualifications, // <--- looks like the same lint
tss-esapi/src/structures/buffers.rs:365:            #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers.rs:369:            #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers.rs:396:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/public.rs:27:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/sensitive.rs:26:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/sensitive_create.rs:26:    #[allow(unused_qualifications)]
tss-esapi/src/structures/ecc/point.rs:52:        #[allow(unused_qualifications)]
tss-esapi/src/structures/nv/storage/public.rs:30:    #[allow(unused_qualifications)]
$ cargo version
cargo 1.81.0 (2dbb1af80 2024-08-20)

Maybe I'm holding it wrong. I wonder what do you see on your computer 🤔

Thanks for re-checking!

This commit addresses most of the problems
reported by the Clippy lint tool when building
with rust version 1.80 for the code in the 7.x.y
branch.

Signed-off-by: Jesper Brynolf <[email protected]>
@Superhepper
Copy link
Collaborator Author

I just checked and it seems it doesn't:

cryptoki$ git grep mem::siz
src/mechanism/mod.rs:17:use std::mem::size_of;
src/object.rs:14:use std::mem::size_of;
cryptoki$ cargo clippy
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
cryptoki$ cargo build
   Compiling cryptoki-sys v0.1.8 (/home/wiktor/src/open-source/cryptoki/cryptoki-sys)
   Compiling cfg-if v1.0.0
   Compiling zeroize v1.7.0
   Compiling log v0.4.20
   Compiling bitflags v1.3.2
   Compiling libloading v0.7.4
   Compiling secrecy v0.8.0
   Compiling cryptoki v0.7.0 (/home/wiktor/src/open-source/cryptoki/cryptoki)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.93s
cryptoki$ git grep unused
src/lib.rs:38:       unused,
src/lib.rs:39:       unused_allocation,
src/lib.rs:40:       unused_comparisons,
src/lib.rs:41:       unused_parens,
src/lib.rs:49:       unused_extern_crates,
src/lib.rs:50:       unused_import_braces,
src/lib.rs:51:       unused_qualifications,  // <---- it's here
src/lib.rs:52:       unused_results)]
rust-tss-esapi$ git grep unused_qua
tss-esapi/src/lib.rs:27:    unused_qualifications, // <--- looks like the same lint
tss-esapi/src/structures/buffers.rs:365:            #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers.rs:369:            #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers.rs:396:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/public.rs:27:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/sensitive.rs:26:    #[allow(unused_qualifications)]
tss-esapi/src/structures/buffers/sensitive_create.rs:26:    #[allow(unused_qualifications)]
tss-esapi/src/structures/ecc/point.rs:52:        #[allow(unused_qualifications)]
tss-esapi/src/structures/nv/storage/public.rs:30:    #[allow(unused_qualifications)]
$ cargo version
cargo 1.81.0 (2dbb1af80 2024-08-20)

Maybe I'm holding it wrong. I wonder what do you see on your computer 🤔

Thanks for re-checking!

You were absolutely right so I changed it. I will do the same thing for the main branch when I got the other stuff merged.

@wiktor-k
Copy link
Collaborator

Thanks!

Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 💯

@ionut-arm ionut-arm merged commit e9a94a7 into parallaxsecond:7.x.y Sep 25, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants