From ca7b00a6f23e780d1a6e1e86f743dfca1aeaf2e4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Dec 2023 11:43:43 +0900 Subject: [PATCH] Update dependency Rust to v1.75.0 (#716) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependency Rust to v1.75.0 * `x.get(i).unwrap()` → `x[i]` `x.get(i).unwrap()`としているところを、すべて`x[i]`にする。 `clippy::get_first`が`.get(0).unwrap()`という表現を咎めるようになった ことへの対応であるが、他の`.get(_).unwrap()`もそんなに数が無いので この際に一括で置き換えてしまうことにする。 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ryo Yamashita --- crates/voicevox_core/src/engine/full_context_label.rs | 10 +++++----- rust-toolchain | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/voicevox_core/src/engine/full_context_label.rs b/crates/voicevox_core/src/engine/full_context_label.rs index efe419579..79928d246 100644 --- a/crates/voicevox_core/src/engine/full_context_label.rs +++ b/crates/voicevox_core/src/engine/full_context_label.rs @@ -51,7 +51,7 @@ static J1_REGEX: Lazy = Lazy::new(|| Regex::new(r"(/J:(\d+|xx)_)").unwrap fn string_feature_by_regex(re: &Regex, label: &str) -> std::result::Result { if let Some(caps) = re.captures(label) { - Ok(caps.get(2).unwrap().as_str().to_string()) + Ok(caps[2].to_string()) } else { Err(ErrorKind::LabelParse { label: label.into(), @@ -144,11 +144,11 @@ impl AccentPhrase { != phonemes.get(i + 1).unwrap().contexts().get("a2").unwrap() { if mora_phonemes.len() == 1 { - moras.push(Mora::new(None, mora_phonemes.get(0).unwrap().clone())); + moras.push(Mora::new(None, mora_phonemes[0].clone())); } else if mora_phonemes.len() == 2 { moras.push(Mora::new( - Some(mora_phonemes.get(0).unwrap().clone()), - mora_phonemes.get(1).unwrap().clone(), + Some(mora_phonemes[0].clone()), + mora_phonemes[1].clone(), )); } else { return Err(ErrorKind::TooLongMora { mora_phonemes }); @@ -157,7 +157,7 @@ impl AccentPhrase { } } - let mora = moras.get(0).unwrap(); + let mora = &moras[0]; let mut accent: usize = mora .vowel() .contexts() diff --git a/rust-toolchain b/rust-toolchain index 80627411d..7c7053aa2 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.74.1 +1.75.0