Skip to content

Commit

Permalink
Update dependency Rust to v1.75.0 (#716)
Browse files Browse the repository at this point in the history
* 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 <qryxip@gmail.com>
  • Loading branch information
renovate[bot] and qryxip authored Dec 29, 2023
1 parent 8ed8d35 commit ca7b00a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crates/voicevox_core/src/engine/full_context_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static J1_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"(/J:(\d+|xx)_)").unwrap

fn string_feature_by_regex(re: &Regex, label: &str) -> std::result::Result<String, ErrorKind> {
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(),
Expand Down Expand Up @@ -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 });
Expand All @@ -157,7 +157,7 @@ impl AccentPhrase {
}
}

let mora = moras.get(0).unwrap();
let mora = &moras[0];
let mut accent: usize = mora
.vowel()
.contexts()
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.74.1
1.75.0

0 comments on commit ca7b00a

Please sign in to comment.