clippy fixes

This commit is contained in:
Robin Appelman 2025-02-25 19:59:45 +01:00
commit 0e0674a0f6
4 changed files with 10 additions and 7 deletions

View file

@ -401,5 +401,5 @@ fn test_serde_value() {
#[test]
fn test_serde_from_value() {
let j = Value::from("1");
assert_eq!(true, unwrap_err(crate::from_entry(j.into())));
assert!(unwrap_err(crate::from_entry(j.into())));
}

View file

@ -107,7 +107,7 @@ const VALUE_TOKEN: &[Token] = &[
Token::GroupStart,
];
impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> {
impl<'de> de::Deserializer<'de> for &'_ mut Deserializer<'de> {
type Error = VdfError;
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
@ -518,7 +518,7 @@ impl<'source, 'a> TableWalker<'source, 'a> {
}
}
impl<'de, 'a> MapAccess<'de> for TableWalker<'de, 'a> {
impl<'de> MapAccess<'de> for TableWalker<'de, '_> {
type Error = VdfError;
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
@ -572,7 +572,7 @@ impl<'source, 'a> SeqWalker<'source, 'a> {
}
}
impl<'de, 'a> SeqAccess<'de> for SeqWalker<'de, 'a> {
impl<'de> SeqAccess<'de> for SeqWalker<'de, '_> {
type Error = VdfError;
fn next_element_seed<T>(
@ -673,7 +673,7 @@ impl<'a, 'de> Enum<'a, 'de> {
//
// Note that all enum deserialization methods in Serde refer exclusively to the
// "externally tagged" enum representation.
impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> {
impl<'de> EnumAccess<'de> for Enum<'_, 'de> {
type Error = VdfError;
type Variant = Self;
@ -697,7 +697,7 @@ impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> {
// `VariantAccess` is provided to the `Visitor` to give it the ability to see
// the content of the single variant that it decided to deserialize.
impl<'de, 'a> VariantAccess<'de> for Enum<'a, 'de> {
impl<'de> VariantAccess<'de> for Enum<'_, 'de> {
type Error = VdfError;
fn unit_variant(self) -> Result<()> {

View file

@ -38,7 +38,7 @@ impl<'source> Tokenizer<'source> {
}
}
impl<'source> Iterator for Tokenizer<'source> {
impl Iterator for Tokenizer<'_> {
type Item = Result<SpannedToken, Span>;
fn next(&mut self) -> Option<Self::Item> {

View file

@ -1,3 +1,5 @@
#![allow(clippy::disallowed_names)]
use miette::{GraphicalReportHandler, GraphicalTheme};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
@ -7,6 +9,7 @@ use vdf_reader::entry::Table;
use vdf_reader::{from_entry, from_str};
#[derive(Debug, Serialize, Deserialize)]
#[allow(clippy::large_enum_variant)]
enum Expected {
Types {
fixed_array: [u8; 3],