Fix Clippy for Rust 1.85 (#3017)

* Fix latest Clippy

* fixed template

* How did I not see this
This commit is contained in:
Dominik Maier 2025-02-21 13:15:12 +01:00 committed by GitHub
parent 5746df835e
commit 14eee111c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 0 additions and 40 deletions

View File

@ -214,14 +214,12 @@ impl EventConfig {
}
impl From<&str> for EventConfig {
#[must_use]
fn from(name: &str) -> Self {
Self::from_name(name)
}
}
impl From<String> for EventConfig {
#[must_use]
fn from(name: String) -> Self {
Self::from_name(&name)
}

View File

@ -43,7 +43,6 @@ impl<T> ListFeedbackMetadata<T> {
}
impl<T> Default for ListFeedbackMetadata<T> {
#[must_use]
fn default() -> Self {
Self::new()
}

View File

@ -271,7 +271,6 @@ libafl_bolts::impl_serdeany!(MapNoveltiesMetadata);
impl Deref for MapNoveltiesMetadata {
type Target = [usize];
/// Convert to a slice
#[must_use]
fn deref(&self) -> &[usize] {
&self.list
}
@ -279,7 +278,6 @@ impl Deref for MapNoveltiesMetadata {
impl DerefMut for MapNoveltiesMetadata {
/// Convert to a slice
#[must_use]
fn deref_mut(&mut self) -> &mut [usize] {
&mut self.list
}

View File

@ -76,7 +76,6 @@ impl NewHashFeedbackMetadata {
impl HashSetState<u64> for NewHashFeedbackMetadata {
/// Create new [`NewHashFeedbackMetadata`] using a name and a hash set.
#[must_use]
fn with_hash_set(hash_set: HashSet<u64>) -> Self {
Self { hash_set }
}

View File

@ -554,7 +554,6 @@ trait InputFilter<I> {
pub struct NopInputFilter;
impl<I> InputFilter<I> for NopInputFilter {
#[inline]
#[must_use]
fn should_execute(&mut self, _input: &I) -> bool {
true
}
@ -579,7 +578,6 @@ impl BloomInputFilter {
#[cfg(feature = "std")]
impl<I: Hash> InputFilter<I> for BloomInputFilter {
#[inline]
#[must_use]
fn should_execute(&mut self, input: &I) -> bool {
!self.bloom.insert(input)
}

View File

@ -201,7 +201,6 @@ pub struct EncodedInput {
impl Input for EncodedInput {
/// Generate a name for this input
#[must_use]
fn generate_name(&self, _id: Option<CorpusId>) -> String {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();
for code in &self.codes {
@ -226,14 +225,12 @@ impl HasLen for EncodedInput {
}
impl From<Vec<u32>> for EncodedInput {
#[must_use]
fn from(codes: Vec<u32>) -> Self {
Self::new(codes)
}
}
impl From<&[u32]> for EncodedInput {
#[must_use]
fn from(codes: &[u32]) -> Self {
Self::new(codes.to_owned())
}

View File

@ -43,7 +43,6 @@ pub struct GramatronInput {
impl Input for GramatronInput {
/// Generate a name for this input
#[must_use]
fn generate_name(&self, _id: Option<CorpusId>) -> String {
let mut hasher = RandomState::with_seeds(0, 0, 0, 0).build_hasher();
for term in &self.terms {

View File

@ -417,7 +417,6 @@ impl fmt::Display for ClientPerfStats {
}
impl Default for ClientPerfStats {
#[must_use]
fn default() -> Self {
Self::new()
}

View File

@ -46,7 +46,6 @@ impl Deref for LogMutationMetadata {
}
}
impl DerefMut for LogMutationMetadata {
#[must_use]
fn deref_mut(&mut self) -> &mut [Cow<'static, str>] {
&mut self.list
}

View File

@ -189,7 +189,6 @@ impl<'a> BacktraceObserver<'a> {
impl ObserverWithHashField for BacktraceObserver<'_> {
/// Gets the hash value of this observer.
#[must_use]
fn hash(&self) -> Option<u64> {
*self.hash.as_ref()
}
@ -345,7 +344,6 @@ impl AsanBacktraceObserver {
impl ObserverWithHashField for AsanBacktraceObserver {
/// Gets the hash value of this observer.
#[must_use]
fn hash(&self) -> Option<u64> {
self.hash
}

View File

@ -238,7 +238,6 @@ static mut PUSH_STAGE_ADAPTER_ID: usize = 0;
pub static PUSH_STAGE_ADAPTER_NAME: &str = "pushstageadapter";
impl<CS, EM, I, OT, PS, Z> Named for PushStageAdapter<CS, EM, I, OT, PS, Z> {
#[must_use]
fn name(&self) -> &Cow<'static, str> {
&self.name
}

View File

@ -230,7 +230,6 @@ where
}
impl AsRef<[u8]> for OwnedRef<'_, [u8]> {
#[must_use]
fn as_ref(&self) -> &[u8] {
match self {
OwnedRef::RefRaw(r, _) => unsafe { (*r).as_ref().unwrap() },
@ -244,7 +243,6 @@ impl<T> AsRef<T> for OwnedRef<'_, T>
where
T: Sized,
{
#[must_use]
fn as_ref(&self) -> &T {
match self {
OwnedRef::RefRaw(r, _) => unsafe { (*r).as_ref().unwrap() },
@ -258,7 +256,6 @@ impl<T> IntoOwned for OwnedRef<'_, T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self {
OwnedRef::RefRaw(..) | OwnedRef::Ref(_) => false,
@ -266,7 +263,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
match self {
OwnedRef::RefRaw(r, _) => {
@ -361,7 +357,6 @@ where
}
impl<T: ?Sized> AsRef<T> for OwnedRefMut<'_, T> {
#[must_use]
fn as_ref(&self) -> &T {
match self {
OwnedRefMut::RefRaw(r, _) => unsafe { r.as_ref().unwrap() },
@ -372,7 +367,6 @@ impl<T: ?Sized> AsRef<T> for OwnedRefMut<'_, T> {
}
impl<T: ?Sized> AsMut<T> for OwnedRefMut<'_, T> {
#[must_use]
fn as_mut(&mut self) -> &mut T {
match self {
OwnedRefMut::RefRaw(r, _) => unsafe { r.as_mut().unwrap() },
@ -386,7 +380,6 @@ impl<T> IntoOwned for OwnedRefMut<'_, T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self {
OwnedRefMut::RefRaw(..) | OwnedRefMut::Ref(_) => false,
@ -394,7 +387,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
match self {
OwnedRefMut::RefRaw(r, _) => unsafe {
@ -592,7 +584,6 @@ impl<T> IntoOwned for OwnedSlice<'_, T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self.inner {
OwnedSliceInner::RefRaw(..) | OwnedSliceInner::Ref(_) => false,
@ -600,7 +591,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
match self.inner {
OwnedSliceInner::RefRaw(rr, len, _) => Self {
@ -787,7 +777,6 @@ impl<T> IntoOwned for OwnedMutSlice<'_, T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self.inner {
OwnedMutSliceInner::RefRaw(..) | OwnedMutSliceInner::Ref(_) => false,
@ -795,7 +784,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
let vec = match self.inner {
OwnedMutSliceInner::RefRaw(rr, len, _) => unsafe {
@ -987,7 +975,6 @@ impl<T, const N: usize> IntoOwned for OwnedMutSizedSlice<'_, T, N>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self.inner {
OwnedMutSizedSliceInner::RefRaw(..) | OwnedMutSizedSliceInner::Ref(_) => false,
@ -995,7 +982,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
let slice: Box<[T; N]> = match self.inner {
OwnedMutSizedSliceInner::RefRaw(rr, _) => unsafe { Box::from((*rr).clone()) },
@ -1116,7 +1102,6 @@ where
}
impl<T: Sized> AsRef<T> for OwnedPtr<T> {
#[must_use]
fn as_ref(&self) -> &T {
match self {
OwnedPtr::Ptr(p) => unsafe { p.as_ref().unwrap() },
@ -1129,7 +1114,6 @@ impl<T> IntoOwned for OwnedPtr<T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self {
OwnedPtr::Ptr(_) => false,
@ -1137,7 +1121,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
match self {
OwnedPtr::Ptr(p) => unsafe { OwnedPtr::Owned(Box::new(p.as_ref().unwrap().clone())) },
@ -1206,7 +1189,6 @@ where
}
impl<T: Sized> AsRef<T> for OwnedMutPtr<T> {
#[must_use]
fn as_ref(&self) -> &T {
match self {
OwnedMutPtr::Ptr(p) => unsafe { p.as_ref().unwrap() },
@ -1228,7 +1210,6 @@ impl<T> IntoOwned for OwnedMutPtr<T>
where
T: Sized + Clone,
{
#[must_use]
fn is_owned(&self) -> bool {
match self {
OwnedMutPtr::Ptr(_) => false,
@ -1236,7 +1217,6 @@ where
}
}
#[must_use]
fn into_owned(self) -> Self {
match self {
OwnedMutPtr::Ptr(p) => unsafe {

View File

@ -215,7 +215,6 @@ impl ToolWrapper for ArWrapper {
impl Default for ArWrapper {
/// Create a new Clang Wrapper
#[must_use]
fn default() -> Self {
Self::new()
}

View File

@ -545,7 +545,6 @@ impl CompilerWrapper for ClangWrapper {
}
impl Default for ClangWrapper {
/// Create a new Clang Wrapper
#[must_use]
fn default() -> Self {
Self::new()
}

View File

@ -251,7 +251,6 @@ impl ToolWrapper for LibtoolWrapper {
impl Default for LibtoolWrapper {
/// Create a new Clang Wrapper
#[must_use]
fn default() -> Self {
Self::new()
}