mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Fix issues found by rust-clippy
This commit is contained in:
parent
6303126e0c
commit
20beaf5af3
23 changed files with 106 additions and 121 deletions
|
@ -95,7 +95,7 @@ impl ViewportLength {
|
|||
}
|
||||
|
||||
impl FromMeta for Zoom {
|
||||
fn from_meta<'a>(value: &'a str) -> Option<Zoom> {
|
||||
fn from_meta(value: &str) -> Option<Zoom> {
|
||||
Some(match value {
|
||||
v if v.eq_ignore_ascii_case("yes") => Zoom::Number(1.),
|
||||
v if v.eq_ignore_ascii_case("no") => Zoom::Number(0.1),
|
||||
|
@ -113,7 +113,7 @@ impl FromMeta for Zoom {
|
|||
}
|
||||
|
||||
impl FromMeta for UserZoom {
|
||||
fn from_meta<'a>(value: &'a str) -> Option<UserZoom> {
|
||||
fn from_meta(value: &str) -> Option<UserZoom> {
|
||||
Some(match value {
|
||||
v if v.eq_ignore_ascii_case("yes") => UserZoom::Zoom,
|
||||
v if v.eq_ignore_ascii_case("no") => UserZoom::Fixed,
|
||||
|
@ -377,13 +377,13 @@ impl ViewportRule {
|
|||
start: usize)
|
||||
-> Option<(&'a str, &'a str)>
|
||||
{
|
||||
fn end_of_token<'a>(iter: &mut Enumerate<Chars<'a>>) -> Option<(usize, char)> {
|
||||
fn end_of_token(iter: &mut Enumerate<Chars>) -> Option<(usize, char)> {
|
||||
iter.by_ref()
|
||||
.skip_while(|&(_, c)| !is_whitespace_separator_or_equals(&c))
|
||||
.next()
|
||||
}
|
||||
|
||||
fn skip_whitespace<'a>(iter: &mut Enumerate<Chars<'a>>) -> Option<(usize, char)> {
|
||||
fn skip_whitespace(iter: &mut Enumerate<Chars>) -> Option<(usize, char)> {
|
||||
iter.by_ref()
|
||||
.skip_while(|&(_, c)| WHITESPACE.contains(&c))
|
||||
.next()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue