mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
parent
f5e97ef1b5
commit
9c11781880
20 changed files with 25 additions and 29 deletions
|
@ -50,7 +50,7 @@ impl ByteString {
|
|||
/// [RFC 2616](http://tools.ietf.org/html/rfc2616#page-17).
|
||||
pub fn is_token(&self) -> bool {
|
||||
let ByteString(ref vec) = *self;
|
||||
if vec.len() == 0 {
|
||||
if vec.is_empty() {
|
||||
return false; // A token must be at least a single character
|
||||
}
|
||||
vec.iter().all(|&x| {
|
||||
|
|
|
@ -970,7 +970,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
|
|||
/// https://html.spec.whatwg.org/multipage/#dom-window-cancelanimationframe
|
||||
fn cancel_animation_frame(self, ident: i32) {
|
||||
self.animation_frame_list.borrow_mut().remove(&ident);
|
||||
if self.animation_frame_list.borrow().len() == 0 {
|
||||
if self.animation_frame_list.borrow().is_empty() {
|
||||
let window = self.window.root();
|
||||
let window = window.r();
|
||||
let ConstellationChan(ref chan) = window.constellation_chan();
|
||||
|
|
|
@ -231,7 +231,7 @@ impl<'a> HTMLScriptElementHelpers for &'a HTMLScriptElement {
|
|||
}
|
||||
// Step 4.
|
||||
let text = self.Text();
|
||||
if text.len() == 0 && !element.has_attribute(&atom!("src")) {
|
||||
if text.is_empty() && !element.has_attribute(&atom!("src")) {
|
||||
return NextParserState::Continue;
|
||||
}
|
||||
// Step 5.
|
||||
|
|
|
@ -2135,7 +2135,7 @@ impl<'a> NodeMethods for &'a Node {
|
|||
NodeTypeId::DocumentFragment |
|
||||
NodeTypeId::Element(..) => {
|
||||
// Step 1-2.
|
||||
let node = if value.len() == 0 {
|
||||
let node = if value.is_empty() {
|
||||
None
|
||||
} else {
|
||||
let document = self.owner_doc();
|
||||
|
|
|
@ -497,7 +497,7 @@ impl<'a> XMLHttpRequestMethods for &'a XMLHttpRequest {
|
|||
// Step 7
|
||||
self.upload_complete.set(match extracted {
|
||||
None => true,
|
||||
Some (ref v) if v.len() == 0 => true,
|
||||
Some (ref v) if v.is_empty() => true,
|
||||
_ => false
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue