Skip to content

Commit 69ba649

Browse files
committed
Stop using deprecated trim methods
1 parent a52a8e1 commit 69ba649

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,6 @@ where
13901390
}
13911391
}
13921392

1393-
#[allow(deprecated)] // `trim_left_matches` and `trim_right_matches` since 1.33
13941393
fn from_str_generic<T, E, F>(s: &str, from: F) -> Result<Complex<T>, ParseComplexError<E>>
13951394
where
13961395
F: Fn(&str) -> Result<T, E>,
@@ -1412,8 +1411,8 @@ where
14121411
// ignore '+'/'-' if part of an exponent
14131412
if (c == b'+' || c == b'-') && !(p == b'e' || p == b'E') {
14141413
// trim whitespace around the separator
1415-
a = &s[..=i].trim_right_matches(char::is_whitespace);
1416-
b = &s[i + 2..].trim_left_matches(char::is_whitespace);
1414+
a = s[..=i].trim_end_matches(char::is_whitespace);
1415+
b = s[i + 2..].trim_start_matches(char::is_whitespace);
14171416
neg_b = c == b'-';
14181417

14191418
if b.is_empty() || (neg_b && b.starts_with('-')) {

0 commit comments

Comments
 (0)