From c051fa7258373f3e367bb32a8953176c0b2f3688 Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Sun, 9 Nov 2025 01:40:46 +0100 Subject: [PATCH] chore: Fix mismatched_lifetime_syntaxes lint --- fluent-bundle/benches/resolver.rs | 2 +- fluent-bundle/benches/resolver_iai.rs | 2 +- fluent-bundle/src/args.rs | 2 +- fluent-bundle/tests/resolver_fixtures.rs | 2 +- fluent-pseudo/src/lib.rs | 4 ++-- fluent-syntax/src/unicode.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fluent-bundle/benches/resolver.rs b/fluent-bundle/benches/resolver.rs index a024da05..6396d370 100644 --- a/fluent-bundle/benches/resolver.rs +++ b/fluent-bundle/benches/resolver.rs @@ -37,7 +37,7 @@ fn get_ids(res: &FluentResource) -> Vec { .collect() } -fn get_args(name: &str) -> Option { +fn get_args(name: &str) -> Option> { match name { "preferences" => { let mut prefs_args = FluentArgs::new(); diff --git a/fluent-bundle/benches/resolver_iai.rs b/fluent-bundle/benches/resolver_iai.rs index 05df9bee..856fe27f 100644 --- a/fluent-bundle/benches/resolver_iai.rs +++ b/fluent-bundle/benches/resolver_iai.rs @@ -12,7 +12,7 @@ fn add_functions(name: &'static str, bundle: &mut FluentBundle) { } } -fn get_args(name: &str) -> Option { +fn get_args(name: &str) -> Option> { match name { "preferences" => { let mut prefs_args = FluentArgs::new(); diff --git a/fluent-bundle/src/args.rs b/fluent-bundle/src/args.rs index 58a560e0..6f6ca1ba 100644 --- a/fluent-bundle/src/args.rs +++ b/fluent-bundle/src/args.rs @@ -93,7 +93,7 @@ impl<'args> FluentArgs<'args> { } /// Iterate over a tuple of the key an [`FluentValue`]. - pub fn iter(&self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator)> { self.0.iter().map(|(k, v)| (k.as_ref(), v)) } } diff --git a/fluent-bundle/tests/resolver_fixtures.rs b/fluent-bundle/tests/resolver_fixtures.rs index 711efba2..157f7694 100644 --- a/fluent-bundle/tests/resolver_fixtures.rs +++ b/fluent-bundle/tests/resolver_fixtures.rs @@ -16,7 +16,7 @@ use unic_langid::LanguageIdentifier; use helpers::*; -fn transform_example(s: &str) -> Cow { +fn transform_example(s: &str) -> Cow<'_, str> { s.replace('a', "A").into() } diff --git a/fluent-pseudo/src/lib.rs b/fluent-pseudo/src/lib.rs index 4f5af15c..b0a555e5 100644 --- a/fluent-pseudo/src/lib.rs +++ b/fluent-pseudo/src/lib.rs @@ -24,7 +24,7 @@ static FLIPPED_CAPS_MAP: &[char] = &[ static RE_EXCLUDED: Lazy = Lazy::new(|| Regex::new(r"&[#\w]+;|<\s*.+?\s*>").unwrap()); static RE_AZ: Lazy = Lazy::new(|| Regex::new(r"[a-zA-Z]").unwrap()); -pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) -> Cow { +pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) -> Cow<'_, str> { // Exclude access-keys and other single-char messages if s.len() == 1 { return s.into(); @@ -62,7 +62,7 @@ pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) result } -pub fn transform(s: &str, flipped: bool, elongate: bool) -> Cow { +pub fn transform(s: &str, flipped: bool, elongate: bool) -> Cow<'_, str> { let (small_map, caps_map) = if flipped { (FLIPPED_SMALL_MAP, FLIPPED_CAPS_MAP) } else { diff --git a/fluent-syntax/src/unicode.rs b/fluent-syntax/src/unicode.rs index ff220098..2492b96e 100644 --- a/fluent-syntax/src/unicode.rs +++ b/fluent-syntax/src/unicode.rs @@ -133,7 +133,7 @@ where /// "Foo 😊 Bar" /// ); /// ``` -pub fn unescape_unicode_to_string(input: &str) -> Cow { +pub fn unescape_unicode_to_string(input: &str) -> Cow<'_, str> { let mut result = String::new(); let owned = unescape(&mut result, input).expect("String write methods don't Err"); if owned {