Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5c2e274

Browse files
authoredMay 31, 2024
Rollup merge of rust-lang#125730 - mu001999-contrib:clippy-fix, r=oli-obk
Apply `x clippy --fix` and `x fmt` on Rustc <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> Just run `x clippy --fix` and `x fmt`, and remove some changes like `impl Default`.
2 parents 9fe1803 + 6f01ba7 commit 5c2e274

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎proc_macro/src/bridge/fxhash.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl Hasher for FxHasher {
6969
hash.add_to_hash(u16::from_ne_bytes(bytes[..2].try_into().unwrap()) as usize);
7070
bytes = &bytes[2..];
7171
}
72-
if (size_of::<usize>() > 1) && bytes.len() >= 1 {
72+
if (size_of::<usize>() > 1) && !bytes.is_empty() {
7373
hash.add_to_hash(bytes[0] as usize);
7474
}
7575
self.hash = hash.hash;

‎proc_macro/src/bridge/rpc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ impl From<Box<dyn Any + Send>> for PanicMessage {
264264
}
265265
}
266266

267-
impl Into<Box<dyn Any + Send>> for PanicMessage {
268-
fn into(self) -> Box<dyn Any + Send> {
269-
match self {
267+
impl From<PanicMessage> for Box<dyn Any + Send> {
268+
fn from(val: PanicMessage) -> Self {
269+
match val {
270270
PanicMessage::StaticStr(s) => Box::new(s),
271271
PanicMessage::String(s) => Box::new(s),
272272
PanicMessage::Unknown => {

‎test/src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Test Attributes:
200200
pub fn parse_opts(args: &[String]) -> Option<OptRes> {
201201
// Parse matches.
202202
let opts = optgroups();
203-
let binary = args.get(0).map(|c| &**c).unwrap_or("...");
203+
let binary = args.first().map(|c| &**c).unwrap_or("...");
204204
let args = args.get(1..).unwrap_or(args);
205205
let matches = match opts.parse(args) {
206206
Ok(m) => m,

‎test/src/term/terminfo/parm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8>, String> {
524524
} else {
525525
let mut s_ = Vec::with_capacity(flags.width);
526526
s_.extend(repeat(b' ').take(n));
527-
s_.extend(s.into_iter());
527+
s_.extend(s);
528528
s = s_;
529529
}
530530
}

0 commit comments

Comments
 (0)
Failed to load comments.