mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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()
|
.collect()
|
||||||
}
|
}
|
||||||
fn suffix_pair<'a>(&self, domain: &'a str) -> (&'a str, &'a str) {
|
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 suffix = domain;
|
||||||
let mut prev_suffix = domain;
|
let mut prev_suffix = domain;
|
||||||
for (index, _) in domain.match_indices(".") {
|
for (index, _) in domain.match_indices(".") {
|
||||||
|
@ -96,7 +96,7 @@ impl PubDomainRules {
|
||||||
// Speeded-up version of
|
// Speeded-up version of
|
||||||
// domain != "" &&
|
// domain != "" &&
|
||||||
// self.public_suffix(domain) == domain.
|
// self.public_suffix(domain) == domain.
|
||||||
let domain = domain.trim_left_matches(".");
|
let domain = domain.trim_start_matches(".");
|
||||||
match domain.find(".") {
|
match domain.find(".") {
|
||||||
None => !domain.is_empty(),
|
None => !domain.is_empty(),
|
||||||
Some(index) => {
|
Some(index) => {
|
||||||
|
@ -109,7 +109,7 @@ impl PubDomainRules {
|
||||||
// Speeded-up version of
|
// Speeded-up version of
|
||||||
// self.public_suffix(domain) != domain &&
|
// self.public_suffix(domain) != domain &&
|
||||||
// self.registrable_suffix(domain) == domain.
|
// self.registrable_suffix(domain) == domain.
|
||||||
let domain = domain.trim_left_matches(".");
|
let domain = domain.trim_start_matches(".");
|
||||||
match domain.find(".") {
|
match domain.find(".") {
|
||||||
None => false,
|
None => false,
|
||||||
Some(index) => {
|
Some(index) => {
|
||||||
|
|
|
@ -69,7 +69,7 @@ where
|
||||||
digits[0] = (x % 10) as u8 + b'0';
|
digits[0] = (x % 10) as u8 + b'0';
|
||||||
|
|
||||||
let s = str::from_utf8(&digits[..]).unwrap();
|
let s = str::from_utf8(&digits[..]).unwrap();
|
||||||
fmt.write_str(s.trim_right_matches('0'))
|
fmt.write_str(s.trim_end_matches('0'))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,7 @@ pub fn parse_length(mut value: &str) -> LengthOrPercentageOrAuto {
|
||||||
// Steps 1 & 2 are not relevant
|
// Steps 1 & 2 are not relevant
|
||||||
|
|
||||||
// Step 3
|
// Step 3
|
||||||
value = value.trim_left_matches(HTML_SPACE_CHARACTERS);
|
value = value.trim_start_matches(HTML_SPACE_CHARACTERS);
|
||||||
|
|
||||||
// Step 4
|
// Step 4
|
||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
|
|
|
@ -778,7 +778,7 @@ impl ToCss for FontLanguageOverride {
|
||||||
} else {
|
} else {
|
||||||
unsafe { str::from_utf8_unchecked(&buf) }
|
unsafe { str::from_utf8_unchecked(&buf) }
|
||||||
};
|
};
|
||||||
slice.trim_right().to_css(dest)
|
slice.trim_end().to_css(dest)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -692,7 +692,7 @@ impl<'a> Iterator for TemplateAreasTokenizer<'a> {
|
||||||
type Item = Result<Option<&'a str>, ()>;
|
type Item = Result<Option<&'a str>, ()>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
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() {
|
if rest.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
/// If the first Camel segment is "Moz", "Webkit", or "Servo", the result string
|
||||||
/// is prepended with "-".
|
/// is prepended with "-".
|
||||||
pub fn to_css_identifier(mut camel_case: &str) -> String {
|
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 first = true;
|
||||||
let mut result = String::with_capacity(camel_case.len());
|
let mut result = String::with_capacity(camel_case.len());
|
||||||
while let Some(segment) = split_camel_segment(&mut camel_case) {
|
while let Some(segment) = split_camel_segment(&mut camel_case) {
|
||||||
|
|
|
@ -161,7 +161,7 @@ pub unsafe extern "C" fn heartbeat_servo(servo: *mut ServoInstance) {
|
||||||
// Servo heartbeat goes here!
|
// Servo heartbeat goes here!
|
||||||
if let Some(servo) = servo.as_mut() {
|
if let Some(servo) = servo.as_mut() {
|
||||||
servo.servo.handle_events(vec![]);
|
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 {
|
match event {
|
||||||
// Respond to any messages with a response channel
|
// Respond to any messages with a response channel
|
||||||
// to avoid deadlocking the constellation
|
// to avoid deadlocking the constellation
|
||||||
|
@ -554,7 +554,7 @@ impl log::Log for MLLogger {
|
||||||
log::Level::Trace => MLLogLevel::Verbose,
|
log::Level::Trace => MLLogLevel::Verbose,
|
||||||
};
|
};
|
||||||
let mut msg = SmallVec::<[u8; 128]>::new();
|
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 _);
|
(self.0)(lvl, &msg[0] as *const _ as *const _);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue