Skip to content
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
2 changes: 1 addition & 1 deletion fluent-bundle/benches/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn get_ids(res: &FluentResource) -> Vec<String> {
.collect()
}

fn get_args(name: &str) -> Option<FluentArgs> {
fn get_args(name: &str) -> Option<FluentArgs<'_>> {
match name {
"preferences" => {
let mut prefs_args = FluentArgs::new();
Expand Down
2 changes: 1 addition & 1 deletion fluent-bundle/benches/resolver_iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn add_functions<R>(name: &'static str, bundle: &mut FluentBundle<R>) {
}
}

fn get_args(name: &str) -> Option<FluentArgs> {
fn get_args(name: &str) -> Option<FluentArgs<'_>> {
match name {
"preferences" => {
let mut prefs_args = FluentArgs::new();
Expand Down
2 changes: 1 addition & 1 deletion fluent-bundle/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<'args> FluentArgs<'args> {
}

/// Iterate over a tuple of the key an [`FluentValue`].
pub fn iter(&self) -> impl Iterator<Item = (&str, &FluentValue)> {
pub fn iter(&self) -> impl Iterator<Item = (&str, &FluentValue<'_>)> {
self.0.iter().map(|(k, v)| (k.as_ref(), v))
}
}
Expand Down
2 changes: 1 addition & 1 deletion fluent-bundle/tests/resolver_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use unic_langid::LanguageIdentifier;

use helpers::*;

fn transform_example(s: &str) -> Cow<str> {
fn transform_example(s: &str) -> Cow<'_, str> {
s.replace('a', "A").into()
}

Expand Down
4 changes: 2 additions & 2 deletions fluent-pseudo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static FLIPPED_CAPS_MAP: &[char] = &[
static RE_EXCLUDED: Lazy<Regex> = Lazy::new(|| Regex::new(r"&[#\w]+;|<\s*.+?\s*>").unwrap());
static RE_AZ: Lazy<Regex> = Lazy::new(|| Regex::new(r"[a-zA-Z]").unwrap());

pub fn transform_dom(s: &str, flipped: bool, elongate: bool, with_markers: bool) -> Cow<str> {
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();
Expand Down Expand Up @@ -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<str> {
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 {
Expand Down
2 changes: 1 addition & 1 deletion fluent-syntax/src/unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ where
/// "Foo 😊 Bar"
/// );
/// ```
pub fn unescape_unicode_to_string(input: &str) -> Cow<str> {
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 {
Expand Down