ascii_domain

Domains whose labels are only ASCII.
git clone https://git.philomathiclife.com/repos/ascii_domain
Log | Files | Refs | README

commit 2858a84ec2ea7391d8ec73ca86aa47ecedb514ca
parent dfa4309dccf129e3002209e5f41fd037abe3c605
Author: Zack Newman <zack@philomathiclife.com>
Date:   Wed, 27 Mar 2024 13:55:12 -0600

add more lints

Diffstat:
MCargo.toml | 6+++---
Msrc/lib.rs | 8++++++++
Msrc/serde.rs | 13++++++++-----
3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml @@ -9,17 +9,17 @@ license = "MIT OR Apache-2.0" name = "ascii_domain" readme = "README.md" repository = "https://git.philomathiclife.com/repos/ascii_domain/" -version = "0.6.0" +version = "0.6.1" [lib] name = "ascii_domain" path = "src/lib.rs" [dependencies] -serde = { version = "1.0.196", default-features = false, features = ["alloc"], optional = true } +serde = { version = "1.0.197", default-features = false, features = ["alloc"], optional = true } [dev-dependencies] -serde_json = { version = "1.0.113", default-features = false, features = ["alloc"] } +serde_json = { version = "1.0.115", default-features = false, features = ["alloc"] } [build-dependencies] rustc_version = "0.4.0" diff --git a/src/lib.rs b/src/lib.rs @@ -16,6 +16,14 @@ #![no_std] #![cfg_attr(all(doc, CHANNEL_NIGHTLY), feature(doc_auto_cfg))] #![deny( + future_incompatible, + let_underscore, + missing_docs, + nonstandard_style, + rust_2018_compatibility, + rust_2018_idioms, + rust_2021_compatibility, + rust_2024_compatibility, unsafe_code, unused, warnings, diff --git a/src/serde.rs b/src/serde.rs @@ -5,7 +5,10 @@ use crate::{ dom::{Domain, DomainErr, Rfc1123Domain, Rfc1123Err}, }; use alloc::{borrow::ToOwned, string::String}; -use core::{fmt, marker::PhantomData}; +use core::{ + fmt::{self, Formatter}, + marker::PhantomData, +}; use serde::{ de::{self, Deserialize, Deserializer, Unexpected, Visitor}, ser::{Serialize, Serializer}, @@ -111,7 +114,7 @@ impl<'a, T, T2> DomainVisitor<'a, T, T2> { impl<'de: 'b, 'a, 'b, T: AsRef<[u8]>> Visitor<'de> for DomainVisitor<'a, T, &'b str> { type Value = Domain<&'b str>; #[inline] - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { formatter.write_str("Domain") } #[inline] @@ -125,7 +128,7 @@ impl<'de: 'b, 'a, 'b, T: AsRef<[u8]>> Visitor<'de> for DomainVisitor<'a, T, &'b impl<'de, 'a, T: AsRef<[u8]>> Visitor<'de> for DomainVisitor<'a, T, String> { type Value = Domain<String>; #[inline] - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { formatter.write_str("Domain") } #[inline] @@ -179,7 +182,7 @@ struct Rfc1123Visitor<T>(PhantomData<fn() -> T>); impl<'de: 'a, 'a> Visitor<'de> for Rfc1123Visitor<&'a str> { type Value = Rfc1123Domain<&'a str>; #[inline] - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { formatter.write_str("Rfc1123Domain") } #[inline] @@ -193,7 +196,7 @@ impl<'de: 'a, 'a> Visitor<'de> for Rfc1123Visitor<&'a str> { impl<'de> Visitor<'de> for Rfc1123Visitor<String> { type Value = Rfc1123Domain<String>; #[inline] - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { formatter.write_str("Rfc1123Domain") } #[inline]