mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
clippy: Fix needless borrow warnings (#31813)
This commit is contained in:
parent
694e86ecff
commit
3e63f8d6ee
42 changed files with 151 additions and 157 deletions
|
@ -44,17 +44,17 @@ impl CharacterData {
|
|||
pub fn clone_with_data(&self, data: DOMString, document: &Document) -> DomRoot<Node> {
|
||||
match self.upcast::<Node>().type_id() {
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) => {
|
||||
DomRoot::upcast(Comment::new(data, &document, None))
|
||||
DomRoot::upcast(Comment::new(data, document, None))
|
||||
},
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) => {
|
||||
let pi = self.downcast::<ProcessingInstruction>().unwrap();
|
||||
DomRoot::upcast(ProcessingInstruction::new(pi.Target(), data, &document))
|
||||
DomRoot::upcast(ProcessingInstruction::new(pi.Target(), data, document))
|
||||
},
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::CDATASection)) => {
|
||||
DomRoot::upcast(CDATASection::new(data, &document))
|
||||
DomRoot::upcast(CDATASection::new(data, document))
|
||||
},
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text(TextTypeId::Text)) => {
|
||||
DomRoot::upcast(Text::new(data, &document))
|
||||
DomRoot::upcast(Text::new(data, document))
|
||||
},
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue