mirror of
https://codeberg.org/icewind/vdf-reader.git
synced 2026-06-03 10:04:08 +02:00
clippy fixes
This commit is contained in:
parent
2ccd57d27e
commit
0e0674a0f6
4 changed files with 10 additions and 7 deletions
|
|
@ -401,5 +401,5 @@ fn test_serde_value() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_serde_from_value() {
|
fn test_serde_from_value() {
|
||||||
let j = Value::from("1");
|
let j = Value::from("1");
|
||||||
assert_eq!(true, unwrap_err(crate::from_entry(j.into())));
|
assert!(unwrap_err(crate::from_entry(j.into())));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
src/serde.rs
10
src/serde.rs
|
|
@ -107,7 +107,7 @@ const VALUE_TOKEN: &[Token] = &[
|
||||||
Token::GroupStart,
|
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;
|
type Error = VdfError;
|
||||||
|
|
||||||
fn deserialize_any<V>(self, visitor: V) -> Result<V::Value>
|
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;
|
type Error = VdfError;
|
||||||
|
|
||||||
fn next_key_seed<K>(&mut self, seed: K) -> Result<Option<K::Value>>
|
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;
|
type Error = VdfError;
|
||||||
|
|
||||||
fn next_element_seed<T>(
|
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
|
// Note that all enum deserialization methods in Serde refer exclusively to the
|
||||||
// "externally tagged" enum representation.
|
// "externally tagged" enum representation.
|
||||||
impl<'de, 'a> EnumAccess<'de> for Enum<'a, 'de> {
|
impl<'de> EnumAccess<'de> for Enum<'_, 'de> {
|
||||||
type Error = VdfError;
|
type Error = VdfError;
|
||||||
type Variant = Self;
|
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
|
// `VariantAccess` is provided to the `Visitor` to give it the ability to see
|
||||||
// the content of the single variant that it decided to deserialize.
|
// 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;
|
type Error = VdfError;
|
||||||
|
|
||||||
fn unit_variant(self) -> Result<()> {
|
fn unit_variant(self) -> Result<()> {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ impl<'source> Tokenizer<'source> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'source> Iterator for Tokenizer<'source> {
|
impl Iterator for Tokenizer<'_> {
|
||||||
type Item = Result<SpannedToken, Span>;
|
type Item = Result<SpannedToken, Span>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(clippy::disallowed_names)]
|
||||||
|
|
||||||
use miette::{GraphicalReportHandler, GraphicalTheme};
|
use miette::{GraphicalReportHandler, GraphicalTheme};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
@ -7,6 +9,7 @@ use vdf_reader::entry::Table;
|
||||||
use vdf_reader::{from_entry, from_str};
|
use vdf_reader::{from_entry, from_str};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
#[allow(clippy::large_enum_variant)]
|
||||||
enum Expected {
|
enum Expected {
|
||||||
Types {
|
Types {
|
||||||
fixed_array: [u8; 3],
|
fixed_array: [u8; 3],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue