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

Resolve clippy lints #225

Merged
merged 3 commits into from
Jul 26, 2020
Merged

Resolve clippy lints #225

merged 3 commits into from
Jul 26, 2020

Conversation

connorkuehl
Copy link
Contributor

@connorkuehl connorkuehl commented May 19, 2020

Sorry if this PR is just noise, but I saw some other commits cleaning clippy warnings up.

I'm happy to squash this into 1 commit too, if that's the preference.

edit: the clippy output is saved in each commit

Connor Kuehl added 3 commits May 19, 2020 14:02
warning: unnecessary parentheses around assigned value
   --> src/mach/constants.rs:222:42
    |
222 |     pub const CPU_TYPE_X86_64: CpuType = (CPU_TYPE_X86 | CPU_ARCH_ABI64);
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
    |
    = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around assigned value
   --> src/mach/constants.rs:227:41
    |
227 |     pub const CPU_TYPE_ARM64: CpuType = (CPU_TYPE_ARM | CPU_ARCH_ABI64);
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around assigned value
   --> src/mach/constants.rs:228:44
    |
228 |     pub const CPU_TYPE_ARM64_32: CpuType = (CPU_TYPE_ARM | CPU_ARCH_ABI64_32);
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around assigned value
   --> src/mach/constants.rs:234:45
    |
234 |     pub const CPU_TYPE_POWERPC64: CpuType = (CPU_TYPE_POWERPC | CPU_ARCH_ABI64);
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
warning: this import is redundant
 --> src/error.rs:7:1
  |
7 | use scroll;
  | ^^^^^^^^^^^ help: remove it entirely
  |
  = note: `#[warn(clippy::single_component_path_imports)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
   --> src/lib.rs:114:5
    |
114 |     use scroll;
    |     ^^^^^^^^^^^ help: remove it entirely
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
warning: this import is redundant
   --> src/elf/program_header.rs:376:5
    |
376 |     use plain;
    |     ^^^^^^^^^^ help: remove it entirely
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
   --> src/elf/program_header.rs:411:5
    |
411 |     use plain;
    |     ^^^^^^^^^^ help: remove it entirely
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here, missed this, always feel free to ping me if i don't respond :)

@@ -111,7 +111,6 @@ pub mod strtab;

/// Binary container size information and byte-order context
pub mod container {
use scroll;
Copy link
Owner

Choose a reason for hiding this comment

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

interesting how come this and above use aren't warnings?

pub const CPU_TYPE_MIPS: CpuType = 8;
pub const CPU_TYPE_MC98000: CpuType = 10;
pub const CPU_TYPE_HPPA: CpuType = 11;
pub const CPU_TYPE_ARM: CpuType = 12;
pub const CPU_TYPE_ARM64: CpuType = (CPU_TYPE_ARM | CPU_ARCH_ABI64);
pub const CPU_TYPE_ARM64_32: CpuType = (CPU_TYPE_ARM | CPU_ARCH_ABI64_32);
Copy link
Owner

Choose a reason for hiding this comment

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

i'm surprised this isn't a warning either

@m4b m4b merged commit b37f41e into m4b:master Jul 26, 2020
@m4b
Copy link
Owner

m4b commented Jul 26, 2020

@connorkuehl So i squashed the commits, and removed the clippy warnings from message; i've merged some like this before, but i don't think its super useful (although it was useful to me when i reviewed it, maybe thats a point for keeping them). Anyway, hope you don't mind, and thanks for the PR and sorry for such late merge!

@connorkuehl connorkuehl deleted the clippy branch July 26, 2020 04:39
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.

2 participants