mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Rustfmt has changed its default style :/
This commit is contained in:
parent
82fc6d9f49
commit
be69f9c3e6
207 changed files with 1200 additions and 1339 deletions
|
@ -1532,11 +1532,9 @@ impl Element {
|
|||
|
||||
pub fn get_int_attribute(&self, local_name: &LocalName, default: i32) -> i32 {
|
||||
// TODO: Is this assert necessary?
|
||||
assert!(
|
||||
local_name
|
||||
.chars()
|
||||
.all(|ch| !ch.is_ascii() || ch.to_ascii_lowercase() == ch)
|
||||
);
|
||||
assert!(local_name
|
||||
.chars()
|
||||
.all(|ch| !ch.is_ascii() || ch.to_ascii_lowercase() == ch));
|
||||
let attribute = self.get_attribute(&ns!(), local_name);
|
||||
|
||||
match attribute {
|
||||
|
@ -1557,11 +1555,9 @@ impl Element {
|
|||
}
|
||||
|
||||
pub fn get_uint_attribute(&self, local_name: &LocalName, default: u32) -> u32 {
|
||||
assert!(
|
||||
local_name
|
||||
.chars()
|
||||
.all(|ch| !ch.is_ascii() || ch.to_ascii_lowercase() == ch)
|
||||
);
|
||||
assert!(local_name
|
||||
.chars()
|
||||
.all(|ch| !ch.is_ascii() || ch.to_ascii_lowercase() == ch));
|
||||
let attribute = self.get_attribute(&ns!(), local_name);
|
||||
match attribute {
|
||||
Some(ref attribute) => match *attribute.value() {
|
||||
|
@ -2840,10 +2836,11 @@ impl<'a> SelectorsElement for DomRoot<Element> {
|
|||
|
||||
fn is_empty(&self) -> bool {
|
||||
self.node.children().all(|node| {
|
||||
!node.is::<Element>() && match node.downcast::<Text>() {
|
||||
None => true,
|
||||
Some(text) => text.upcast::<CharacterData>().data().is_empty(),
|
||||
}
|
||||
!node.is::<Element>() &&
|
||||
match node.downcast::<Text>() {
|
||||
None => true,
|
||||
Some(text) => text.upcast::<CharacterData>().data().is_empty(),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue