Skip to content

Commit

Permalink
Apply x clippy --fix and x fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed May 30, 2024
1 parent 1aaf0a9 commit 6f01ba7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion proc_macro/src/bridge/fxhash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Hasher for FxHasher {
hash.add_to_hash(u16::from_ne_bytes(bytes[..2].try_into().unwrap()) as usize);
bytes = &bytes[2..];
}
if (size_of::<usize>() > 1) && bytes.len() >= 1 {
if (size_of::<usize>() > 1) && !bytes.is_empty() {
hash.add_to_hash(bytes[0] as usize);
}
self.hash = hash.hash;
Expand Down
6 changes: 3 additions & 3 deletions proc_macro/src/bridge/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ impl From<Box<dyn Any + Send>> for PanicMessage {
}
}

impl Into<Box<dyn Any + Send>> for PanicMessage {
fn into(self) -> Box<dyn Any + Send> {
match self {
impl From<PanicMessage> for Box<dyn Any + Send> {
fn from(val: PanicMessage) -> Self {
match val {
PanicMessage::StaticStr(s) => Box::new(s),
PanicMessage::String(s) => Box::new(s),
PanicMessage::Unknown => {
Expand Down
2 changes: 1 addition & 1 deletion test/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Test Attributes:
pub fn parse_opts(args: &[String]) -> Option<OptRes> {
// Parse matches.
let opts = optgroups();
let binary = args.get(0).map(|c| &**c).unwrap_or("...");
let binary = args.first().map(|c| &**c).unwrap_or("...");
let args = args.get(1..).unwrap_or(args);
let matches = match opts.parse(args) {
Ok(m) => m,
Expand Down
2 changes: 1 addition & 1 deletion test/src/term/terminfo/parm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8>, String> {
} else {
let mut s_ = Vec::with_capacity(flags.width);
s_.extend(repeat(b' ').take(n));
s_.extend(s.into_iter());
s_.extend(s);
s = s_;
}
}
Expand Down

0 comments on commit 6f01ba7

Please sign in to comment.