Skip to content

Commit 0ed652d

Browse files
committed
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
1 parent b352151 commit 0ed652d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/i18n.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ simple_loader!(create_loader, "./locales/", "en-US", core: "./locales/core.ftl",
1717
fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
1818
bundle
1919
.add_function("EMAIL", |values, _named| {
20-
let email = match values.get(0) {
20+
let email = match values.first() {
2121
Some(FluentValue::String(ref s)) => s,
2222
_ => return FluentValue::None,
2323
};
@@ -27,7 +27,7 @@ fn add_bundle_functions(bundle: &mut FluentBundle<&'static FluentResource>) {
2727

2828
bundle
2929
.add_function("ENGLISH", |values, _named| {
30-
let text = match values.get(0) {
30+
let text = match values.first() {
3131
Some(FluentValue::String(ref s)) => s,
3232
_ => return FluentValue::None,
3333
};

0 commit comments

Comments
 (0)