mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix issues found by rust-clippy
This commit is contained in:
parent
6303126e0c
commit
20beaf5af3
23 changed files with 106 additions and 121 deletions
|
@ -123,9 +123,9 @@ impl HeapSizeOf for url::Url {
|
|||
|
||||
impl HeapSizeOf for url::SchemeData {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&url::SchemeData::Relative(ref data) => data.heap_size_of_children(),
|
||||
&url::SchemeData::NonRelative(ref str) => str.heap_size_of_children()
|
||||
match *self {
|
||||
url::SchemeData::Relative(ref data) => data.heap_size_of_children(),
|
||||
url::SchemeData::NonRelative(ref str) => str.heap_size_of_children()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,9 +147,9 @@ impl HeapSizeOf for url::RelativeSchemeData {
|
|||
|
||||
impl HeapSizeOf for url::Host {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&url::Host::Domain(ref str) => str.heap_size_of_children(),
|
||||
&url::Host::Ipv6(_) => 0
|
||||
match *self {
|
||||
url::Host::Domain(ref str) => str.heap_size_of_children(),
|
||||
url::Host::Ipv6(_) => 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -302,8 +302,8 @@ impl<T: Copy + GCMethods<T>> HeapSizeOf for Heap<T> {
|
|||
|
||||
impl HeapSizeOf for Method {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&Method::Extension(ref str) => str.heap_size_of_children(),
|
||||
match *self {
|
||||
Method::Extension(ref str) => str.heap_size_of_children(),
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
@ -311,9 +311,9 @@ impl HeapSizeOf for Method {
|
|||
|
||||
impl<T: HeapSizeOf, U: HeapSizeOf> HeapSizeOf for Result<T, U> {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&Result::Ok(ref ok) => ok.heap_size_of_children(),
|
||||
&Result::Err(ref err) => err.heap_size_of_children()
|
||||
match *self {
|
||||
Result::Ok(ref ok) => ok.heap_size_of_children(),
|
||||
Result::Err(ref err) => err.heap_size_of_children()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -341,13 +341,13 @@ impl HeapSizeOf for CompoundSelector {
|
|||
|
||||
impl HeapSizeOf for SimpleSelector {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&SimpleSelector::Negation(ref vec) => vec.heap_size_of_children(),
|
||||
&SimpleSelector::AttrIncludes(_, ref str) | &SimpleSelector::AttrPrefixMatch(_, ref str) |
|
||||
&SimpleSelector::AttrSubstringMatch(_, ref str) | &SimpleSelector::AttrSuffixMatch(_, ref str)
|
||||
match *self {
|
||||
SimpleSelector::Negation(ref vec) => vec.heap_size_of_children(),
|
||||
SimpleSelector::AttrIncludes(_, ref str) | SimpleSelector::AttrPrefixMatch(_, ref str) |
|
||||
SimpleSelector::AttrSubstringMatch(_, ref str) | SimpleSelector::AttrSuffixMatch(_, ref str)
|
||||
=> str.heap_size_of_children(),
|
||||
&SimpleSelector::AttrEqual(_, ref str, _) => str.heap_size_of_children(),
|
||||
&SimpleSelector::AttrDashMatch(_, ref first, ref second) => first.heap_size_of_children()
|
||||
SimpleSelector::AttrEqual(_, ref str, _) => str.heap_size_of_children(),
|
||||
SimpleSelector::AttrDashMatch(_, ref first, ref second) => first.heap_size_of_children()
|
||||
+ second.heap_size_of_children(),
|
||||
// All other types come down to Atom, enum or i32, all 0
|
||||
_ => 0
|
||||
|
@ -372,8 +372,8 @@ impl HeapSizeOf for Mime {
|
|||
|
||||
impl HeapSizeOf for TopLevel {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&TopLevel::Ext(ref str) => str.heap_size_of_children(),
|
||||
match *self {
|
||||
TopLevel::Ext(ref str) => str.heap_size_of_children(),
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
@ -381,8 +381,8 @@ impl HeapSizeOf for TopLevel {
|
|||
|
||||
impl HeapSizeOf for SubLevel {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&SubLevel::Ext(ref str) => str.heap_size_of_children(),
|
||||
match *self {
|
||||
SubLevel::Ext(ref str) => str.heap_size_of_children(),
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
@ -390,8 +390,8 @@ impl HeapSizeOf for SubLevel {
|
|||
|
||||
impl HeapSizeOf for Attr {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&Attr::Ext(ref str) => str.heap_size_of_children(),
|
||||
match *self {
|
||||
Attr::Ext(ref str) => str.heap_size_of_children(),
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
@ -399,8 +399,8 @@ impl HeapSizeOf for Attr {
|
|||
|
||||
impl HeapSizeOf for Value {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
match self {
|
||||
&Value::Ext(ref str) => str.heap_size_of_children(),
|
||||
match *self {
|
||||
Value::Ext(ref str) => str.heap_size_of_children(),
|
||||
_ => 0
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue