clippy: Fix needless borrow warnings (#31813)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 18:48:54 +01:00 committed by GitHub
parent 694e86ecff
commit 3e63f8d6ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 151 additions and 157 deletions

View file

@ -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!(),
}