mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: fix several lint warns (#32126)
As seems #31500 still remain opened here's the next partial fix. Fixed list: `unused_mut`, `clippy::needless_borrow`, `clippy::match_ref_pats`, `clippy::borrow_deref_ref`, `clippy::ptr_eq`, `clippy::unnecessary_cast`, `clippy::derivable_impls`, `clippy::collapsible_match`, `clippy::extra_unused_lifetimes`, `clippy::map_clone`, `clippy::manual_filter`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes are part of #31500. - [x] These changes do not require tests because are only cosmetic.
This commit is contained in:
parent
025a987732
commit
67f239d1ba
17 changed files with 54 additions and 83 deletions
|
@ -1305,10 +1305,7 @@ impl Element {
|
|||
match xmlSerialize::serialize(
|
||||
&mut writer,
|
||||
&self.upcast::<Node>(),
|
||||
XmlSerializeOpts {
|
||||
traversal_scope,
|
||||
..Default::default()
|
||||
},
|
||||
XmlSerializeOpts { traversal_scope },
|
||||
) {
|
||||
Ok(()) => Ok(DOMString::from(String::from_utf8(writer).unwrap())),
|
||||
Err(_) => panic!("Cannot serialize element"),
|
||||
|
@ -3065,10 +3062,10 @@ impl VirtualMethods for Element {
|
|||
}
|
||||
|
||||
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
|
||||
match name {
|
||||
&local_name!("id") => AttrValue::from_atomic(value.into()),
|
||||
&local_name!("name") => AttrValue::from_atomic(value.into()),
|
||||
&local_name!("class") => AttrValue::from_serialized_tokenlist(value.into()),
|
||||
match *name {
|
||||
local_name!("id") => AttrValue::from_atomic(value.into()),
|
||||
local_name!("name") => AttrValue::from_atomic(value.into()),
|
||||
local_name!("class") => AttrValue::from_serialized_tokenlist(value.into()),
|
||||
_ => self
|
||||
.super_type()
|
||||
.unwrap()
|
||||
|
@ -3198,7 +3195,7 @@ impl VirtualMethods for Element {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> SelectorsElement for DomRoot<Element> {
|
||||
impl SelectorsElement for DomRoot<Element> {
|
||||
type Impl = SelectorImpl;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue