Skip to content

Commit e121d8d

Browse files
committed
Fix some more deprecation warnings
1 parent 6c76f2e commit e121d8d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

data-url/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'a> FragmentIdentifier<'a> {
128128
/// - ASCII tabs and newlines in the middle are **not** removed
129129
fn pretend_parse_data_url(input: &str) -> Option<&str> {
130130
// Trim C0 control or space
131-
let left_trimmed = input.trim_left_matches(|ch| ch <= ' ');
131+
let left_trimmed = input.trim_start_matches(|ch| ch <= ' ');
132132

133133
let mut bytes = left_trimmed.bytes();
134134
{
@@ -146,7 +146,7 @@ fn pretend_parse_data_url(input: &str) -> Option<&str> {
146146
let after_colon = &left_trimmed[bytes_consumed..];
147147

148148
// Trim C0 control or space
149-
Some(after_colon.trim_right_matches(|ch| ch <= ' '))
149+
Some(after_colon.trim_end_matches(|ch| ch <= ' '))
150150
}
151151

152152
fn find_comma_before_fragment(after_colon: &str) -> Option<(&str, &str)> {

data-url/src/mime.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn parse(s: &str) -> Option<Mime> {
4141
require!(only_http_token_code_points(type_) && !type_.is_empty());
4242

4343
let (subtype, rest) = split2(rest?, ';');
44-
let subtype = subtype.trim_right_matches(ascii_whitespace);
44+
let subtype = subtype.trim_end_matches(ascii_whitespace);
4545
require!(only_http_token_code_points(subtype) && !subtype.is_empty());
4646

4747
let mut parameters = Vec::new();
@@ -66,7 +66,7 @@ fn parse_parameters(s: &str, parameters: &mut Vec<(String, String)>) {
6666
let mut semicolon_separated = s.split(';');
6767

6868
while let Some(piece) = semicolon_separated.next() {
69-
let piece = piece.trim_left_matches(ascii_whitespace);
69+
let piece = piece.trim_start_matches(ascii_whitespace);
7070
let (name, value) = split2(piece, '=');
7171
if name.is_empty() || !only_http_token_code_points(name) || contains(&parameters, name) {
7272
continue;
@@ -98,7 +98,7 @@ fn parse_parameters(s: &str, parameters: &mut Vec<(String, String)>) {
9898
}
9999
unescaped_value
100100
} else {
101-
let value = value.trim_right_matches(ascii_whitespace);
101+
let value = value.trim_end_matches(ascii_whitespace);
102102
if !valid_value(value) {
103103
continue;
104104
}

0 commit comments

Comments
 (0)