Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Dec 28, 2018
1 parent be69f9c commit be2218a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions components/net_traits/pub_domains.rs
Expand Up @@ -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(".") {
Expand Down Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion components/net_traits/quality.rs
Expand Up @@ -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'))
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/style/attr.rs
Expand Up @@ -548,7 +548,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
// Steps 1 & 2 are not relevant

// Step 3
value = value.trim_left_matches(HTML_SPACE_CHARACTERS);
value = value.trim_start_matches(HTML_SPACE_CHARACTERS);

// Step 4
if value.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/computed/font.rs
Expand Up @@ -778,7 +778,7 @@ impl ToCss for FontLanguageOverride {
} else {
unsafe { str::from_utf8_unchecked(&buf) }
};
slice.trim_right().to_css(dest)
slice.trim_end().to_css(dest)
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/style/values/specified/position.rs
Expand Up @@ -692,7 +692,7 @@ impl<'a> Iterator for TemplateAreasTokenizer<'a> {
type Item = Result<Option<&'a str>, ()>;

fn next(&mut self) -> Option<Self::Item> {
let rest = self.0.trim_left_matches(HTML_SPACE_CHARACTERS);
let rest = self.0.trim_start_matches(HTML_SPACE_CHARACTERS);
if rest.is_empty() {
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion components/style_derive/cg.rs
Expand Up @@ -252,7 +252,7 @@ pub fn value<'a>(variant: &'a VariantInfo, prefix: &str) -> (TokenStream, Vec<Bi
/// If the first Camel segment is "Moz", "Webkit", or "Servo", the result string
/// is prepended with "-".
pub fn to_css_identifier(mut camel_case: &str) -> String {
camel_case = camel_case.trim_right_matches('_');
camel_case = camel_case.trim_end_matches('_');
let mut first = true;
let mut result = String::with_capacity(camel_case.len());
while let Some(segment) = split_camel_segment(&mut camel_case) {
Expand Down
4 changes: 2 additions & 2 deletions ports/libmlservo/src/lib.rs
Expand Up @@ -161,7 +161,7 @@ pub unsafe extern "C" fn heartbeat_servo(servo: *mut ServoInstance) {
// Servo heartbeat goes here!
if let Some(servo) = servo.as_mut() {
servo.servo.handle_events(vec![]);
for ((browser_id, event)) in servo.servo.get_events() {
for (browser_id, event) in servo.servo.get_events() {
match event {
// Respond to any messages with a response channel
// to avoid deadlocking the constellation
Expand Down Expand Up @@ -554,7 +554,7 @@ impl log::Log for MLLogger {
log::Level::Trace => MLLogLevel::Verbose,
};
let mut msg = SmallVec::<[u8; 128]>::new();
write!(msg, "{}\0", record.args());
write!(msg, "{}\0", record.args()).unwrap();
(self.0)(lvl, &msg[0] as *const _ as *const _);
}

Expand Down

0 comments on commit be2218a

Please sign in to comment.