Skip to content

Commit

Permalink
Stop using deprecated trim methods
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 7, 2024
1 parent a52a8e1 commit 69ba649
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,6 @@ where
}
}

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

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

0 comments on commit 69ba649

Please sign in to comment.