From 0ed652d722c26508cff3b28ebb5a7b8d25dfb010 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 9 Jan 2024 13:39:45 -0800 Subject: [PATCH] Resolve Rust 1.75's new get_first clippy lint warning: accessing first element with `values.get(0)` --> src/i18n.rs:20:31 | 20 | let email = match values.get(0) { | ^^^^^^^^^^^^^ help: try: `values.first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first = note: `#[warn(clippy::get_first)]` on by default warning: accessing first element with `values.get(0)` --> src/i18n.rs:30:30 | 30 | let text = match values.get(0) { | ^^^^^^^^^^^^^ help: try: `values.first()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first --- src/i18n.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n.rs b/src/i18n.rs index 211a3e67..91610dcf 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -17,7 +17,7 @@ simple_loader!(create_loader, "./locales/", "en-US", core: "./locales/core.ftl", fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) { bundle .add_function("EMAIL", |values, _named| { - let email = match values.get(0) { + let email = match values.first() { Some(FluentValue::String(ref s)) => s, _ => return FluentValue::None, }; @@ -27,7 +27,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) { bundle .add_function("ENGLISH", |values, _named| { - let text = match values.get(0) { + let text = match values.first() { Some(FluentValue::String(ref s)) => s, _ => return FluentValue::None, };