Skip to content

Commit 912dbb8

Browse files
authored
Merge pull request #138 from jprochazk/fix-nightly-lints
2 parents 758e022 + 701a596 commit 912dbb8

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

deny.toml

+4-10
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,7 @@ ignore = [
4747
# List of explicitly allowed licenses
4848
# See https://spdx.org/licenses/ for list of possible licenses
4949
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
50-
allow = [
51-
"MIT",
52-
"Apache-2.0",
53-
"Unicode-3.0",
54-
"Unicode-DFS-2016",
55-
"Unlicense",
56-
"BSD-3-Clause",
57-
]
50+
allow = ["MIT", "Apache-2.0", "Unicode-3.0", "Unlicense", "BSD-3-Clause"]
5851
# The confidence threshold for detecting a license from license text.
5952
# The higher the value, the more closely the license text must be to the
6053
# canonical license text of a valid SPDX license file.
@@ -84,8 +77,8 @@ exceptions = [
8477
# and the crate will be checked normally, which may produce warnings or errors
8578
# depending on the rest of your configuration
8679
#license-files = [
87-
# Each entry is a crate relative path, and the (opaque) hash of its contents
88-
#{ path = "LICENSE", hash = 0xbd0eed23 }
80+
# Each entry is a crate relative path, and the (opaque) hash of its contents
81+
#{ path = "LICENSE", hash = 0xbd0eed23 }
8982
#]
9083

9184
[licenses.private]
@@ -153,6 +146,7 @@ allow = [
153146

154147
# Certain crates/versions that will be skipped when doing duplicate detection.
155148
skip = [
149+
{ name = "regex-syntax" }, # phonenumber includes an additional older version...
156150
#{ name = "ansi_term", version = "=0.11.0" },
157151
]
158152
# Similarly to `skip` allows you to skip certain crates during duplicate

garde/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl_path_component_kind!(String => Key);
142142
impl_path_component_kind!(CompactString => Key);
143143
impl_path_component_kind!(NoKey => None);
144144

145-
impl<'a, T: PathComponentKind> PathComponentKind for &'a T {
145+
impl<T: PathComponentKind> PathComponentKind for &T {
146146
fn component_kind() -> Kind {
147147
T::component_kind()
148148
}
@@ -197,7 +197,7 @@ impl std::fmt::Debug for Path {
197197
path: &'a Path,
198198
}
199199

200-
impl<'a> std::fmt::Debug for Components<'a> {
200+
impl std::fmt::Debug for Components<'_> {
201201
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
202202
let mut list = f.debug_list();
203203
list.entries(self.path.__iter().rev().map(|(_, c)| c))

garde/src/rules/inner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl<const N: usize, T> Inner<T> for [T; N] {
5050
}
5151
}
5252

53-
impl<'a, T> Inner<T> for &'a [T] {
53+
impl<T> Inner<T> for &[T] {
5454
type Key = usize;
5555

5656
fn validate_inner<F>(&self, mut f: F)

garde/src/rules/length/simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<const N: usize, T> Simple for [T; N] {
9292
}
9393
}
9494

95-
impl<'a, const N: usize, T> Simple for &'a [T; N] {
95+
impl<const N: usize, T> Simple for &[T; N] {
9696
fn validate_length(&self, min: usize, max: usize) -> Result<(), Error> {
9797
super::check_len(self.len(), min, max)
9898
}

garde/src/rules/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub trait AsStr {
2525
fn as_str(&self) -> &str;
2626
}
2727

28-
impl<'a> AsStr for &'a str {
28+
impl AsStr for &str {
2929
fn as_str(&self) -> &str {
3030
self
3131
}
@@ -37,7 +37,7 @@ impl AsStr for String {
3737
}
3838
}
3939

40-
impl<'a> AsStr for std::borrow::Cow<'a, str> {
40+
impl AsStr for std::borrow::Cow<'_, str> {
4141
fn as_str(&self) -> &str {
4242
std::borrow::Cow::as_ref(self)
4343
}

garde/src/validate.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<T: Debug> Debug for Unvalidated<T> {
120120
}
121121
}
122122

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

126126
fn validate_into(
@@ -133,7 +133,7 @@ impl<'a, T: ?Sized + Validate> Validate for &'a T {
133133
}
134134
}
135135

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

139139
fn validate_into(
@@ -332,7 +332,7 @@ impl<T: Validate> Validate for Option<T> {
332332
}
333333
}
334334

335-
impl<'a, B: Validate> Validate for std::borrow::Cow<'a, B>
335+
impl<B: Validate> Validate for std::borrow::Cow<'_, B>
336336
where
337337
B: ToOwned,
338338
{

garde_derive/src/emit.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct Type<'a> {
4747
kind: &'a model::ValidateKind,
4848
}
4949

50-
impl<'a> ToTokens for Type<'a> {
50+
impl ToTokens for Type<'_> {
5151
fn to_tokens(&self, tokens: &mut TokenStream2) {
5252
let is_transparent = self.is_transparent;
5353
match &self.kind {
@@ -94,7 +94,7 @@ struct Variant<'a> {
9494
variant: &'a model::ValidateVariant,
9595
}
9696

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

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

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

176-
impl<'a> ToTokens for Inner<'a> {
176+
impl ToTokens for Inner<'_> {
177177
fn to_tokens(&self, tokens: &mut TokenStream2) {
178178
let Inner {
179179
rules_mod,
@@ -231,7 +231,7 @@ enum Binding<'a> {
231231
Index(usize),
232232
}
233233

234-
impl<'a> ToTokens for Binding<'a> {
234+
impl ToTokens for Binding<'_> {
235235
fn to_tokens(&self, tokens: &mut TokenStream2) {
236236
match self {
237237
Binding::Ident(v) => v.to_tokens(tokens),
@@ -240,7 +240,7 @@ impl<'a> ToTokens for Binding<'a> {
240240
}
241241
}
242242

243-
impl<'a> ToTokens for Rules<'a> {
243+
impl ToTokens for Rules<'_> {
244244
fn to_tokens(&self, tokens: &mut TokenStream2) {
245245
let Rules {
246246
rules_mod,
@@ -422,7 +422,7 @@ where
422422

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

425-
impl<'a> ToTokens for Bindings<'a> {
425+
impl ToTokens for Bindings<'_> {
426426
fn to_tokens(&self, tokens: &mut TokenStream2) {
427427
match &self.0 {
428428
model::ValidateVariant::Struct(fields) => {

0 commit comments

Comments
 (0)