Added warning for lint clippy::semicolon_if_nothing_returned.

This commit is contained in:
Filipe Rodrigues 2024-03-11 00:30:02 +00:00
parent 37e4995d63
commit 1d0d9898a3
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU
9 changed files with 17 additions and 16 deletions

View File

@ -51,3 +51,4 @@ web-sys = "0.3.68"
clippy.map_unwrap_or = "warn"
clippy.flat_map_option = "warn"
clippy.must_use_candidate = "warn"
clippy.semicolon_if_nothing_returned = "warn"

View File

@ -427,7 +427,7 @@ mod test {
let value = VALUE;
test::black_box(value);
}
})
});
}
#[bench]
@ -439,7 +439,7 @@ mod test {
let value = crate::get::<AccessTy>();
test::black_box(value);
}
})
});
}
#[bench]
@ -451,7 +451,7 @@ mod test {
let value = crate::expect::<AccessTy>();
test::black_box(value);
}
})
});
}
#[bench]
@ -462,7 +462,7 @@ mod test {
for _ in 0..test::black_box(REPEAT_COUNT) {
crate::with::<AccessTy, _, _>(|value| test::black_box(value.copied()));
}
})
});
}
#[bench]
@ -473,7 +473,7 @@ mod test {
for _ in 0..test::black_box(REPEAT_COUNT) {
crate::with_expect::<AccessTy, _, _>(|value| test::black_box(*value));
}
})
});
}
/// Creates several types and attempts to access them all.
@ -498,6 +498,6 @@ mod test {
bencher.iter(|| {
use_ty! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45, T46, T47, T48, T49 }
})
});
}
}

View File

@ -219,7 +219,7 @@ where
.chain(classes.iter().map(C::as_ref))
.join(" ");
self.as_ref().set_class_name(&class_name)
self.as_ref().set_class_name(&class_name);
}
}

View File

@ -133,7 +133,7 @@ where
type Output = ();
extern "rust-call" fn call_once(mut self, args: ()) -> Self::Output {
self.call_mut(args)
self.call_mut(args);
}
}
impl<T, F> FnMut<()> for EffectFn<T, F>
@ -142,7 +142,7 @@ where
F: Fn() -> T,
{
extern "rust-call" fn call_mut(&mut self, args: ()) -> Self::Output {
self.call(args)
self.call(args);
}
}
impl<T, F> Fn<()> for EffectFn<T, F>

View File

@ -354,7 +354,7 @@ mod test {
let effect = effect::running();
test::black_box(effect);
}
})
});
});
}
@ -366,6 +366,6 @@ mod test {
test::black_box(&effect);
mem::forget(effect);
}
})
});
}
}

View File

@ -13,6 +13,6 @@ fn create_unsized() {
sig.with(|dyn_value| {
assert_eq!(dyn_value.type_id(), value.type_id());
assert_eq!(dyn_value.downcast_ref::<i32>(), Some(&value))
assert_eq!(dyn_value.downcast_ref::<i32>(), Some(&value));
});
}

View File

@ -178,8 +178,8 @@ where
queries.push(((*self.signal.key).to_owned(), value));
}
location.query_pairs_mut().clear().extend_pairs(queries);
})
})
});
});
}
}

View File

@ -176,7 +176,7 @@ where
};
location.query_pairs_mut().clear().extend_pairs(queries);
})
});
});
}
}

View File

@ -35,7 +35,7 @@ pub impl web_sys::Element {
None => element
.remove_attribute(key)
.unwrap_or_else(|err| panic!("Unable to remove attribute {key:?}: {err:?}")),
})
});
})
.or_return()?;