Fix some warnings

This commit is contained in:
Simon Sapin 2018-12-26 10:58:50 +01:00
parent be69f9c3e6
commit be2218a134
7 changed files with 10 additions and 10 deletions

View file

@ -66,7 +66,7 @@ impl PubDomainRules {
.collect()
}
fn suffix_pair<'a>(&self, domain: &'a str) -> (&'a str, &'a str) {
let domain = domain.trim_left_matches(".");
let domain = domain.trim_start_matches(".");
let mut suffix = domain;
let mut prev_suffix = domain;
for (index, _) in domain.match_indices(".") {
@ -96,7 +96,7 @@ impl PubDomainRules {
// Speeded-up version of
// domain != "" &&
// self.public_suffix(domain) == domain.
let domain = domain.trim_left_matches(".");
let domain = domain.trim_start_matches(".");
match domain.find(".") {
None => !domain.is_empty(),
Some(index) => {
@ -109,7 +109,7 @@ impl PubDomainRules {
// Speeded-up version of
// self.public_suffix(domain) != domain &&
// self.registrable_suffix(domain) == domain.
let domain = domain.trim_left_matches(".");
let domain = domain.trim_start_matches(".");
match domain.find(".") {
None => false,
Some(index) => {

View file

@ -69,7 +69,7 @@ where
digits[0] = (x % 10) as u8 + b'0';
let s = str::from_utf8(&digits[..]).unwrap();
fmt.write_str(s.trim_right_matches('0'))
fmt.write_str(s.trim_end_matches('0'))
},
}
}