mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
clippy: Fix various clippy warnings in components/scripts/dom/bindings
(#31901)
* single-character string constant used as pattern * singuse of with literal radix of 16
This commit is contained in:
parent
18054d0737
commit
7100465d1a
2 changed files with 3 additions and 3 deletions
|
@ -237,7 +237,7 @@ pub struct ThreadLocalStackRoots<'a>(PhantomData<&'a u32>);
|
||||||
|
|
||||||
impl<'a> ThreadLocalStackRoots<'a> {
|
impl<'a> ThreadLocalStackRoots<'a> {
|
||||||
pub fn new(roots: &'a RootCollection) -> Self {
|
pub fn new(roots: &'a RootCollection) -> Self {
|
||||||
STACK_ROOTS.with(|ref r| r.set(Some(roots)));
|
STACK_ROOTS.with(|r| r.set(Some(roots)));
|
||||||
ThreadLocalStackRoots(PhantomData)
|
ThreadLocalStackRoots(PhantomData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,7 @@ impl DOMString {
|
||||||
if !(
|
if !(
|
||||||
// A valid number is the same as what rust considers to be valid,
|
// A valid number is the same as what rust considers to be valid,
|
||||||
// except for +1., NaN, and Infinity.
|
// except for +1., NaN, and Infinity.
|
||||||
val.is_infinite() || val.is_nan() || input.ends_with(".") || input.starts_with("+")
|
val.is_infinite() || val.is_nan() || input.ends_with(".") || input.starts_with('+')
|
||||||
) {
|
) {
|
||||||
return Some(val);
|
return Some(val);
|
||||||
}
|
}
|
||||||
|
@ -529,7 +529,7 @@ impl DOMString {
|
||||||
pub fn is_valid_simple_color_string(&self) -> bool {
|
pub fn is_valid_simple_color_string(&self) -> bool {
|
||||||
let mut chars = self.0.chars();
|
let mut chars = self.0.chars();
|
||||||
if self.0.len() == 7 && chars.next() == Some('#') {
|
if self.0.len() == 7 && chars.next() == Some('#') {
|
||||||
chars.all(|c| c.is_digit(16))
|
chars.all(|c| c.is_ascii_hexdigit())
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue