mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Fix some warnings
This commit is contained in:
parent
be69f9c3e6
commit
be2218a134
7 changed files with 10 additions and 10 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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'))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue