Skip to content

Commit

Permalink
Fix some more deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jul 17, 2019
1 parent 6c76f2e commit e121d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions data-url/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'a> FragmentIdentifier<'a> {
/// - ASCII tabs and newlines in the middle are **not** removed
fn pretend_parse_data_url(input: &str) -> Option<&str> {
// Trim C0 control or space
let left_trimmed = input.trim_left_matches(|ch| ch <= ' ');
let left_trimmed = input.trim_start_matches(|ch| ch <= ' ');

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

// Trim C0 control or space
Some(after_colon.trim_right_matches(|ch| ch <= ' '))
Some(after_colon.trim_end_matches(|ch| ch <= ' '))
}

fn find_comma_before_fragment(after_colon: &str) -> Option<(&str, &str)> {
Expand Down
6 changes: 3 additions & 3 deletions data-url/src/mime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn parse(s: &str) -> Option<Mime> {
require!(only_http_token_code_points(type_) && !type_.is_empty());

let (subtype, rest) = split2(rest?, ';');
let subtype = subtype.trim_right_matches(ascii_whitespace);
let subtype = subtype.trim_end_matches(ascii_whitespace);
require!(only_http_token_code_points(subtype) && !subtype.is_empty());

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

while let Some(piece) = semicolon_separated.next() {
let piece = piece.trim_left_matches(ascii_whitespace);
let piece = piece.trim_start_matches(ascii_whitespace);
let (name, value) = split2(piece, '=');
if name.is_empty() || !only_http_token_code_points(name) || contains(&parameters, name) {
continue;
Expand Down Expand Up @@ -98,7 +98,7 @@ fn parse_parameters(s: &str, parameters: &mut Vec<(String, String)>) {
}
unescaped_value
} else {
let value = value.trim_right_matches(ascii_whitespace);
let value = value.trim_end_matches(ascii_whitespace);
if !valid_value(value) {
continue;
}
Expand Down

0 comments on commit e121d8d

Please sign in to comment.