Skip to content

Commit 8a7159c

Browse files
committed
cargo clippy fix
1 parent caa1ce1 commit 8a7159c

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

src/iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ pub struct Children<'a, T: 'a> {
176176
impl<'a, T: 'a> Clone for Children<'a, T> {
177177
fn clone(&self) -> Self {
178178
Self {
179-
front: self.front.clone(),
180-
back: self.back.clone(),
179+
front: self.front,
180+
back: self.back,
181181
}
182182
}
183183
}

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ impl<'a, T: 'a> Eq for NodeRef<'a, T> {}
128128
impl<'a, T: 'a> PartialEq for NodeRef<'a, T> {
129129
fn eq(&self, other: &Self) -> bool {
130130
self.id == other.id
131-
&& self.tree as *const _ == other.tree as *const _
132-
&& self.node as *const _ == other.node as *const _
131+
&& std::ptr::eq(self.tree, other.tree)
132+
&& std::ptr::eq(self.node, other.node)
133133
}
134134
}
135135

tests/node_mut.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ fn last_child() {
6666
#[test]
6767
fn has_siblings() {
6868
let mut tree = tree!('a' => { 'b', 'c' });
69-
assert_eq!(true, tree.root_mut().first_child().unwrap().has_siblings());
70-
assert_eq!(false, tree.root_mut().has_siblings());
69+
assert!(tree.root_mut().first_child().unwrap().has_siblings());
70+
assert!(!tree.root_mut().has_siblings());
7171
}
7272

7373
#[test]
7474
fn has_children() {
7575
let mut tree = tree!('a' => { 'b', 'c' });
76-
assert_eq!(true, tree.root_mut().has_children());
77-
assert_eq!(false, tree.root_mut().first_child().unwrap().has_children());
76+
assert!(tree.root_mut().has_children());
77+
assert!(!tree.root_mut().first_child().unwrap().has_children());
7878
}
7979

8080
#[test]
@@ -310,7 +310,7 @@ fn reparent_from_id_append() {
310310
let g = b.last_child().unwrap();
311311
let f = g.prev_sibling().unwrap();
312312

313-
assert_eq!(false, e.has_children());
313+
assert!(!e.has_children());
314314
assert_eq!(&'f', f.value());
315315
assert_eq!(&'g', g.value());
316316
assert_eq!(Some(f), d.next_sibling());
@@ -337,7 +337,7 @@ fn reparent_from_id_prepend() {
337337
let d = c.next_sibling().unwrap();
338338
let f = b.last_child().unwrap().prev_sibling().unwrap();
339339

340-
assert_eq!(false, e.has_children());
340+
assert!(!e.has_children());
341341
assert_eq!(&'c', c.value());
342342
assert_eq!(&'d', d.value());
343343
assert_eq!(Some(f), d.next_sibling());

tests/node_ref.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ fn last_child() {
4343
#[test]
4444
fn has_siblings() {
4545
let tree = tree!('a' => { 'b', 'c' });
46-
assert_eq!(false, tree.root().has_siblings());
47-
assert_eq!(true, tree.root().first_child().unwrap().has_siblings());
46+
assert!(!tree.root().has_siblings());
47+
assert!(tree.root().first_child().unwrap().has_siblings());
4848
}
4949

5050
#[test]
5151
fn has_children() {
5252
let tree = tree!('a' => { 'b', 'c' });
53-
assert_eq!(true, tree.root().has_children());
54-
assert_eq!(false, tree.root().first_child().unwrap().has_children());
53+
assert!(tree.root().has_children());
54+
assert!(!tree.root().first_child().unwrap().has_children());
5555
}
5656

5757
#[test]
5858
fn clone() {
5959
let tree = tree!('a');
6060
let one = tree.root();
61-
let two = one.clone();
61+
let two = one;
6262
assert_eq!(one, two);
6363
}
6464

0 commit comments

Comments
 (0)