Skip to content

Fix some clippy lints #8878

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

Closed
wants to merge 2 commits into from
Closed

Fix some clippy lints #8878

wants to merge 2 commits into from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Nov 22, 2020

This commit can be replicated with
cargo +nightly clippy -Z unstable-options --fix.

I am totally ambivalent as to whether this lands, if you want to close it because you don't like clippy that's fine by me.

This commit can be replicated with
`cargo +nightly clippy -Z unstable-options --fix`.
@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 22, 2020
Copy link
Contributor

@Eh2406 Eh2406 left a comment

Choose a reason for hiding this comment

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

Overall I like all of these except maybe the one.

@@ -470,7 +470,7 @@ pub fn is_simple_exit_code(code: i32) -> bool {
// codes are very large. This is just a rough
// approximation of which codes are "normal" and which
// ones are abnormal termination.
code >= 0 && code <= 127
(0..=127).contains(&code)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @ehuss has been against this one in the past.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I reverted the change.

(Definition::Environment(_), Definition::Path(_)) => true,
_ => false,
}
matches!((self, other), (Definition::Cli, Definition::Environment(_)) | (Definition::Cli, Definition::Path(_)) | (Definition::Environment(_), Definition::Path(_)))
Copy link
Member

Choose a reason for hiding this comment

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

This came up previously, but I don't think this change should be made.

Some(libc::ENOSYS) => true,
_ => false,
}
matches!(err.raw_os_error(), Some(libc::ENOTSUP) | Some(libc::ENOSYS))
Copy link
Member

Choose a reason for hiding this comment

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

I believe the meaning here has changed? The ENOSYS arm is no longer just on Linux.

@@ -22,7 +22,7 @@ fn get_available_targets<'a>(
.map(Target::name)
.collect();

targets.sort();
targets.sort_unstable();
Copy link
Member

Choose a reason for hiding this comment

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

This also came up previously and I don't think this change should be made.

@jyn514
Copy link
Member Author

jyn514 commented Nov 24, 2020

Oh I missed #8831, sorry. Probably that should take precedence over this change.

@jyn514 jyn514 closed this Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants