diff --git a/crates/dictgen/src/map.rs b/crates/dictgen/src/map.rs index fe9d427..c83b686 100644 --- a/crates/dictgen/src/map.rs +++ b/crates/dictgen/src/map.rs @@ -62,14 +62,14 @@ impl DictMap { } } -impl<'s> phf_shared::PhfHash for crate::InsensitiveStr<'s> { +impl phf_shared::PhfHash for crate::InsensitiveStr<'_> { #[inline] fn phf_hash(&self, state: &mut H) { core::hash::Hash::hash(self, state); } } -impl<'s> phf_shared::FmtConst for crate::InsensitiveStr<'s> { +impl phf_shared::FmtConst for crate::InsensitiveStr<'_> { fn fmt_const(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { crate::InsensitiveStr::Ascii(_) => f.write_str("dictgen::InsensitiveStr::Ascii(")?, diff --git a/crates/dictgen/src/table.rs b/crates/dictgen/src/table.rs index 2ac2962..fef6f14 100644 --- a/crates/dictgen/src/table.rs +++ b/crates/dictgen/src/table.rs @@ -98,30 +98,30 @@ impl<'s> From> for InsensitiveStr<'s> { } } -impl<'s1, 's2> PartialEq> for InsensitiveStr<'s1> { +impl<'s2> PartialEq> for InsensitiveStr<'_> { #[inline] fn eq(&self, other: &InsensitiveStr<'s2>) -> bool { self.convert() == other.convert() } } -impl<'s> Eq for InsensitiveStr<'s> {} +impl Eq for InsensitiveStr<'_> {} -impl<'s> core::hash::Hash for InsensitiveStr<'s> { +impl core::hash::Hash for InsensitiveStr<'_> { #[inline] fn hash(&self, hasher: &mut H) { self.convert().hash(hasher); } } -impl<'s> core::fmt::Debug for InsensitiveStr<'s> { +impl core::fmt::Debug for InsensitiveStr<'_> { #[inline] fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Debug::fmt(self.into_inner(), fmt) } } -impl<'s> core::fmt::Display for InsensitiveStr<'s> { +impl core::fmt::Display for InsensitiveStr<'_> { #[inline] fn fmt(&self, fmt: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { core::fmt::Display::fmt(self.into_inner(), fmt) diff --git a/crates/dictgen/src/trie.rs b/crates/dictgen/src/trie.rs index 5fc021d..4d7803a 100644 --- a/crates/dictgen/src/trie.rs +++ b/crates/dictgen/src/trie.rs @@ -245,7 +245,7 @@ mod codegen { value: Option, } - impl<'s, V> DynNode<'s, V> { + impl DynNode<'_, V> { fn burst(&mut self, limit: usize) { self.children.burst(limit); } @@ -256,7 +256,7 @@ mod codegen { Flat(Vec<(&'s [u8], V)>), } - impl<'s, V> DynChild<'s, V> { + impl DynChild<'_, V> { fn burst(&mut self, limit: usize) { match self { DynChild::Nested(children) => { diff --git a/crates/typos-cli/src/bin/typos-cli/report.rs b/crates/typos-cli/src/bin/typos-cli/report.rs index c45b24e..084155a 100644 --- a/crates/typos-cli/src/bin/typos-cli/report.rs +++ b/crates/typos-cli/src/bin/typos-cli/report.rs @@ -36,7 +36,7 @@ impl<'r> MessageStatus<'r> { } } -impl<'r> Report for MessageStatus<'r> { +impl Report for MessageStatus<'_> { fn report(&self, msg: Message<'_>) -> Result<(), std::io::Error> { if msg.is_typo() { self.typos_found.store(true, atomic::Ordering::Relaxed); diff --git a/crates/typos-cli/src/dict.rs b/crates/typos-cli/src/dict.rs index ab6d70d..2e7fa7e 100644 --- a/crates/typos-cli/src/dict.rs +++ b/crates/typos-cli/src/dict.rs @@ -264,7 +264,7 @@ impl<'i, 'w, D: typos::Dictionary> Override<'i, 'w, D> { } } -impl<'i, 'w, D: typos::Dictionary> typos::Dictionary for Override<'i, 'w, D> { +impl typos::Dictionary for Override<'_, '_, D> { fn correct_ident<'s>(&'s self, ident: typos::tokens::Identifier<'_>) -> Option> { for ignored in &self.ignored_identifiers { if ignored.is_match(ident.token()) { diff --git a/crates/typos-cli/src/policy.rs b/crates/typos-cli/src/policy.rs index e797267..e7a4d3f 100644 --- a/crates/typos-cli/src/policy.rs +++ b/crates/typos-cli/src/policy.rs @@ -359,7 +359,7 @@ pub struct Policy<'t, 'd, 'i> { pub ignore: &'i [regex::Regex], } -impl<'t, 'd, 'i> Policy<'t, 'd, 'i> { +impl Policy<'_, '_, '_> { pub fn new() -> Self { Default::default() } @@ -369,7 +369,7 @@ static DEFAULT_TOKENIZER: typos::tokens::Tokenizer = typos::tokens::Tokenizer::n static DEFAULT_DICT: crate::dict::BuiltIn = crate::dict::BuiltIn::new(crate::config::Locale::En); static DEFAULT_IGNORE: &[regex::Regex] = &[]; -impl<'t, 'd, 'i> Default for Policy<'t, 'd, 'i> { +impl Default for Policy<'_, '_, '_> { fn default() -> Self { Self { check_filenames: true, diff --git a/crates/typos-cli/src/report.rs b/crates/typos-cli/src/report.rs index 96d67a4..81f4c1f 100644 --- a/crates/typos-cli/src/report.rs +++ b/crates/typos-cli/src/report.rs @@ -80,7 +80,7 @@ pub struct Typo<'m> { pub corrections: typos::Status<'m>, } -impl<'m> Default for Typo<'m> { +impl Default for Typo<'_> { fn default() -> Self { Self { context: None, @@ -100,7 +100,7 @@ pub enum Context<'m> { Path(PathContext<'m>), } -impl<'m> std::fmt::Display for Context<'m> { +impl std::fmt::Display for Context<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { match self { Context::File(c) => write!(f, "{}:{}", c.path.display(), c.line_num), @@ -116,7 +116,7 @@ pub struct FileContext<'m> { pub line_num: usize, } -impl<'m> Default for FileContext<'m> { +impl Default for FileContext<'_> { fn default() -> Self { Self { path: std::path::Path::new("-"), @@ -131,7 +131,7 @@ pub struct PathContext<'m> { pub path: &'m std::path::Path, } -impl<'m> Default for PathContext<'m> { +impl Default for PathContext<'_> { fn default() -> Self { Self { path: std::path::Path::new("-"), @@ -160,7 +160,7 @@ impl<'m> FileType<'m> { } } -impl<'m> Default for FileType<'m> { +impl Default for FileType<'_> { fn default() -> Self { Self { path: std::path::Path::new("-"), @@ -181,7 +181,7 @@ impl<'m> File<'m> { } } -impl<'m> Default for File<'m> { +impl Default for File<'_> { fn default() -> Self { Self { path: std::path::Path::new("-"), @@ -198,7 +198,7 @@ pub struct Parse<'m> { pub data: &'m str, } -impl<'m> Default for Parse<'m> { +impl Default for Parse<'_> { fn default() -> Self { Self { context: None, @@ -216,13 +216,13 @@ pub struct Error<'m> { pub msg: String, } -impl<'m> Error<'m> { +impl Error<'_> { pub fn new(msg: String) -> Self { Self { context: None, msg } } } -impl<'m> Default for Error<'m> { +impl Default for Error<'_> { fn default() -> Self { Self { context: None, diff --git a/crates/typos/src/check.rs b/crates/typos/src/check.rs index c20edde..89c3fdb 100644 --- a/crates/typos/src/check.rs +++ b/crates/typos/src/check.rs @@ -70,7 +70,7 @@ pub struct Typo<'m> { pub corrections: crate::Status<'m>, } -impl<'m> Typo<'m> { +impl Typo<'_> { pub fn into_owned(self) -> Typo<'static> { Typo { byte_offset: self.byte_offset, @@ -94,7 +94,7 @@ impl<'m> Typo<'m> { } } -impl<'m> Default for Typo<'m> { +impl Default for Typo<'_> { fn default() -> Self { Self { byte_offset: 0, diff --git a/crates/varcon-core/src/parser.rs b/crates/varcon-core/src/parser.rs index bbb279c..adc6bea 100644 --- a/crates/varcon-core/src/parser.rs +++ b/crates/varcon-core/src/parser.rs @@ -22,7 +22,7 @@ impl<'i> ClusterIter<'i> { } } -impl<'i> Iterator for ClusterIter<'i> { +impl Iterator for ClusterIter<'_> { type Item = Cluster; fn next(&mut self) -> Option {