mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fixed the .clone() warnings. (#31819)
This commit is contained in:
parent
95e69fe4ff
commit
9b26dca141
28 changed files with 76 additions and 93 deletions
|
@ -285,7 +285,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> ServoThreadSafeLayoutNode<'dom, Layo
|
|||
/// Creates a new `ServoThreadSafeLayoutNode` from the given `ServoLayoutNode`.
|
||||
pub fn new(node: ServoLayoutNode<'dom, LayoutDataType>) -> Self {
|
||||
ServoThreadSafeLayoutNode {
|
||||
node: node.clone(),
|
||||
node: node,
|
||||
pseudo: PseudoElementType::Normal,
|
||||
}
|
||||
}
|
||||
|
@ -529,7 +529,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> Iterator
|
|||
PseudoElementType::Before | PseudoElementType::After => None,
|
||||
|
||||
PseudoElementType::DetailsSummary => {
|
||||
let mut current_node = self.current_node.clone();
|
||||
let mut current_node = self.current_node;
|
||||
loop {
|
||||
let next_node = if let Some(ref node) = current_node {
|
||||
if let Some(element) = node.as_element() {
|
||||
|
@ -537,7 +537,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> Iterator
|
|||
element.has_namespace(&ns!(html))
|
||||
{
|
||||
self.current_node = None;
|
||||
return Some(node.clone());
|
||||
return Some(*node);
|
||||
}
|
||||
}
|
||||
unsafe { node.dangerous_next_sibling() }
|
||||
|
@ -550,7 +550,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> Iterator
|
|||
},
|
||||
|
||||
PseudoElementType::DetailsContent => {
|
||||
let node = self.current_node.clone();
|
||||
let node = self.current_node;
|
||||
let node = node.and_then(|node| {
|
||||
if node.is_element() &&
|
||||
node.as_element()
|
||||
|
@ -568,7 +568,7 @@ impl<'dom, LayoutDataType: LayoutDataTrait> Iterator
|
|||
},
|
||||
|
||||
PseudoElementType::Normal => {
|
||||
let node = self.current_node.clone();
|
||||
let node = self.current_node;
|
||||
if let Some(ref node) = node {
|
||||
self.current_node = match node.get_pseudo_element_type() {
|
||||
PseudoElementType::Before => self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue