Skip to content

Commit 394a951

Browse files
committed
Fix lint errors
Signed-off-by: Simon Wülker <[email protected]>
1 parent f9cbd41 commit 394a951

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

html5ever/src/tokenizer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ mod test {
16161616
}
16171617

16181618
fn finish_str(&self) {
1619-
if self.current_str.borrow().len() > 0 {
1619+
if !self.current_str.borrow().is_empty() {
16201620
let s = self.current_str.take();
16211621
self.tokens.borrow_mut().push(CharacterTokens(s));
16221622
}

rcdom/tests/html-tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl TokenLogger {
9292
}
9393

9494
fn finish_str(&self) {
95-
if self.current_str.borrow().len() > 0 {
95+
if !self.current_str.borrow().is_empty() {
9696
let s = self.current_str.take();
9797
self.tokens.borrow_mut().push(CharacterTokens(s));
9898
}

rcdom/tests/html-tree-builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn parse_tests<It: Iterator<Item = String>>(mut lines: It) -> Vec<HashMap<String
7676

7777
fn serialize(buf: &mut String, indent: usize, handle: Handle) {
7878
buf.push('|');
79-
buf.extend(iter::repeat(" ").take(indent));
79+
buf.extend(iter::repeat_n(" ", indent));
8080

8181
let node = handle;
8282
match node.data {
@@ -127,7 +127,7 @@ fn serialize(buf: &mut String, indent: usize, handle: Handle) {
127127

128128
for attr in attrs.into_iter() {
129129
buf.push('|');
130-
buf.extend(iter::repeat(" ").take(indent + 2));
130+
buf.extend(iter::repeat_n(" ", indent + 2));
131131
match attr.name.ns {
132132
ns!(xlink) => buf.push_str("xlink "),
133133
ns!(xml) => buf.push_str("xml "),
@@ -152,7 +152,7 @@ fn serialize(buf: &mut String, indent: usize, handle: Handle) {
152152
{
153153
if let Some(ref content) = &*template_contents.borrow() {
154154
buf.push('|');
155-
buf.extend(iter::repeat(" ").take(indent + 2));
155+
buf.extend(iter::repeat_n(" ", indent + 2));
156156
buf.push_str("content\n");
157157
for child in content.children.borrow().iter() {
158158
serialize(buf, indent + 4, child.clone());

rcdom/tests/xml-tokenizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl TokenLogger {
7979
}
8080

8181
fn finish_str(&self) {
82-
if self.current_str.borrow().len() > 0 {
82+
if !self.current_str.borrow().is_empty() {
8383
let s = self.current_str.take();
8484
self.tokens.borrow_mut().push(CharacterTokens(s));
8585
}

rcdom/tests/xml-tree-builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn parse_tests<It: Iterator<Item = String>>(mut lines: It) -> Vec<HashMap<String
7070

7171
fn serialize(buf: &mut String, indent: usize, handle: Handle) {
7272
buf.push('|');
73-
buf.extend(iter::repeat(" ").take(indent));
73+
buf.extend(iter::repeat_n(" ", indent));
7474

7575
let node = handle;
7676
match &node.data {
@@ -132,7 +132,7 @@ fn serialize(buf: &mut String, indent: usize, handle: Handle) {
132132

133133
for attr in attrs.into_iter() {
134134
buf.push('|');
135-
buf.extend(iter::repeat(" ").take(indent + 2));
135+
buf.extend(iter::repeat_n(" ", indent + 2));
136136

137137
if !attr.name.ns.is_empty() {
138138
buf.push('{');

0 commit comments

Comments
 (0)