Skip to content

Commit 296c055

Browse files
burtonageoThomas Bahn
authored and
Thomas Bahn
committed
Fix compile error, refactor AsciiExt methods
1 parent f6585e8 commit 296c055

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ascii_str.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl AsciiStr {
224224
/// A replacement for `AsciiExt::make_ascii_uppercase()`.
225225
#[cfg(not(feature = "std"))]
226226
pub fn make_ascii_uppercase(&mut self) {
227-
for a in &mut self {
227+
for a in self.chars_mut() {
228228
*a = a.to_ascii_uppercase();
229229
}
230230
}
@@ -234,7 +234,7 @@ impl AsciiStr {
234234
/// A replacement for `AsciiExt::make_ascii_lowercase()`.
235235
#[cfg(not(feature = "std"))]
236236
pub fn make_ascii_lowercase(&mut self) {
237-
for a in &mut self {
237+
for a in self.chars_mut() {
238238
*a = a.to_ascii_lowercase();
239239
}
240240
}
@@ -428,19 +428,19 @@ impl AsciiExt for AsciiStr {
428428

429429
fn eq_ignore_ascii_case(&self, other: &Self) -> bool {
430430
self.len() == other.len() &&
431-
self.slice.iter().zip(other.slice.iter()).all(|(a, b)| {
431+
self.chars().zip(other.chars()).all(|(a, b)| {
432432
a.eq_ignore_ascii_case(b)
433433
})
434434
}
435435

436436
fn make_ascii_uppercase(&mut self) {
437-
for ascii in &mut self.slice {
437+
for ascii in self.chars_mut() {
438438
ascii.make_ascii_uppercase();
439439
}
440440
}
441441

442442
fn make_ascii_lowercase(&mut self) {
443-
for ascii in &mut self.slice {
443+
for ascii in self.chars_mut() {
444444
ascii.make_ascii_lowercase();
445445
}
446446
}

0 commit comments

Comments
 (0)