1
Fork 0

Apply x clippy --fix and x fmt

This commit is contained in:
r0cky 2024-05-30 09:51:27 +08:00
parent f2e1a3a80a
commit dabd05bbab
14 changed files with 28 additions and 30 deletions

View file

@ -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;

View file

@ -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 => {