Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nightly lints #138

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,7 @@ ignore = [
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"MIT",
"Apache-2.0",
"Unicode-3.0",
"Unicode-DFS-2016",
"Unlicense",
"BSD-3-Clause",
]
allow = ["MIT", "Apache-2.0", "Unicode-3.0", "Unlicense", "BSD-3-Clause"]
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
# canonical license text of a valid SPDX license file.
Expand Down Expand Up @@ -84,8 +77,8 @@ exceptions = [
# and the crate will be checked normally, which may produce warnings or errors
# depending on the rest of your configuration
#license-files = [
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
#]

[licenses.private]
Expand Down Expand Up @@ -153,6 +146,7 @@ allow = [

# Certain crates/versions that will be skipped when doing duplicate detection.
skip = [
{ name = "regex-syntax" }, # phonenumber includes an additional older version...
#{ name = "ansi_term", version = "=0.11.0" },
]
# Similarly to `skip` allows you to skip certain crates during duplicate
Expand Down
4 changes: 2 additions & 2 deletions garde/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl_path_component_kind!(String => Key);
impl_path_component_kind!(CompactString => Key);
impl_path_component_kind!(NoKey => None);

impl<'a, T: PathComponentKind> PathComponentKind for &'a T {
impl<T: PathComponentKind> PathComponentKind for &T {
fn component_kind() -> Kind {
T::component_kind()
}
Expand Down Expand Up @@ -197,7 +197,7 @@ impl std::fmt::Debug for Path {
path: &'a Path,
}

impl<'a> std::fmt::Debug for Components<'a> {
impl std::fmt::Debug for Components<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut list = f.debug_list();
list.entries(self.path.__iter().rev().map(|(_, c)| c))
Expand Down
2 changes: 1 addition & 1 deletion garde/src/rules/inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<const N: usize, T> Inner<T> for [T; N] {
}
}

impl<'a, T> Inner<T> for &'a [T] {
impl<T> Inner<T> for &[T] {
type Key = usize;

fn validate_inner<F>(&self, mut f: F)
Expand Down
2 changes: 1 addition & 1 deletion garde/src/rules/length/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<const N: usize, T> Simple for [T; N] {
}
}

impl<'a, const N: usize, T> Simple for &'a [T; N] {
impl<const N: usize, T> Simple for &[T; N] {
fn validate_length(&self, min: usize, max: usize) -> Result<(), Error> {
super::check_len(self.len(), min, max)
}
Expand Down
4 changes: 2 additions & 2 deletions garde/src/rules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait AsStr {
fn as_str(&self) -> &str;
}

impl<'a> AsStr for &'a str {
impl AsStr for &str {
fn as_str(&self) -> &str {
self
}
Expand All @@ -37,7 +37,7 @@ impl AsStr for String {
}
}

impl<'a> AsStr for std::borrow::Cow<'a, str> {
impl AsStr for std::borrow::Cow<'_, str> {
fn as_str(&self) -> &str {
std::borrow::Cow::as_ref(self)
}
Expand Down
6 changes: 3 additions & 3 deletions garde/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<T: Debug> Debug for Unvalidated<T> {
}
}

impl<'a, T: ?Sized + Validate> Validate for &'a T {
impl<T: ?Sized + Validate> Validate for &T {
type Context = T::Context;

fn validate_into(
Expand All @@ -133,7 +133,7 @@ impl<'a, T: ?Sized + Validate> Validate for &'a T {
}
}

impl<'a, T: ?Sized + Validate> Validate for &'a mut T {
impl<T: ?Sized + Validate> Validate for &mut T {
type Context = T::Context;

fn validate_into(
Expand Down Expand Up @@ -332,7 +332,7 @@ impl<T: Validate> Validate for Option<T> {
}
}

impl<'a, B: Validate> Validate for std::borrow::Cow<'a, B>
impl<B: Validate> Validate for std::borrow::Cow<'_, B>
where
B: ToOwned,
{
Expand Down
16 changes: 8 additions & 8 deletions garde_derive/src/emit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct Type<'a> {
kind: &'a model::ValidateKind,
}

impl<'a> ToTokens for Type<'a> {
impl ToTokens for Type<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
let is_transparent = self.is_transparent;
match &self.kind {
Expand Down Expand Up @@ -94,7 +94,7 @@ struct Variant<'a> {
variant: &'a model::ValidateVariant,
}

impl<'a> ToTokens for Variant<'a> {
impl ToTokens for Variant<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
let is_transparent = self.is_transparent;
match &self.variant {
Expand Down Expand Up @@ -122,7 +122,7 @@ struct Struct<'a> {
fields: &'a [(Ident, model::ValidateField)],
}

impl<'a> ToTokens for Struct<'a> {
impl ToTokens for Struct<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
Fields::new(
self.fields
Expand All @@ -147,7 +147,7 @@ struct Tuple<'a> {
fields: &'a [model::ValidateField],
}

impl<'a> ToTokens for Tuple<'a> {
impl ToTokens for Tuple<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
Fields::new(
self.fields
Expand All @@ -173,7 +173,7 @@ struct Inner<'a> {
rule_set: &'a model::RuleSet,
}

impl<'a> ToTokens for Inner<'a> {
impl ToTokens for Inner<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
let Inner {
rules_mod,
Expand Down Expand Up @@ -231,7 +231,7 @@ enum Binding<'a> {
Index(usize),
}

impl<'a> ToTokens for Binding<'a> {
impl ToTokens for Binding<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
match self {
Binding::Ident(v) => v.to_tokens(tokens),
Expand All @@ -240,7 +240,7 @@ impl<'a> ToTokens for Binding<'a> {
}
}

impl<'a> ToTokens for Rules<'a> {
impl ToTokens for Rules<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
let Rules {
rules_mod,
Expand Down Expand Up @@ -422,7 +422,7 @@ where

struct Bindings<'a>(&'a model::ValidateVariant);

impl<'a> ToTokens for Bindings<'a> {
impl ToTokens for Bindings<'_> {
fn to_tokens(&self, tokens: &mut TokenStream2) {
match &self.0 {
model::ValidateVariant::Struct(fields) => {
Expand Down
Loading