Skip to content

Commit 6bfd349

Browse files
char_indices() -> chars()
Co-Authored-By: Noah <[email protected]>
1 parent 6ca4579 commit 6bfd349

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/obj/objstr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,12 @@ impl PyString {
407407

408408
#[pymethod]
409409
fn capitalize(&self) -> String {
410-
let mut char_indices = self.value.char_indices();
411-
if let Some((_, first_char)) = char_indices.next() {
410+
let mut chars = self.value.chars();
411+
if let Some(first_char) = chars.next() {
412412
format!(
413413
"{}{}",
414414
first_char.to_uppercase(),
415-
&self.value[first_char.len_utf8()..].to_lowercase(),
415+
&chars.as_str().to_lowercase(),
416416
)
417417
} else {
418418
"".to_owned()

0 commit comments

Comments
 (0)