mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -34,8 +34,8 @@ impl PrefValue {
|
|||
}
|
||||
|
||||
pub fn as_boolean(&self) -> Option<bool> {
|
||||
match self {
|
||||
&PrefValue::Boolean(value) => {
|
||||
match *self {
|
||||
PrefValue::Boolean(value) => {
|
||||
Some(value)
|
||||
},
|
||||
_ => None
|
||||
|
@ -87,12 +87,12 @@ impl Pref {
|
|||
}
|
||||
|
||||
pub fn value(&self) -> &Arc<PrefValue> {
|
||||
match self {
|
||||
&Pref::NoDefault(ref x) => x,
|
||||
&Pref::WithDefault(ref default, ref override_value) => {
|
||||
match override_value {
|
||||
&Some(ref x) => x,
|
||||
&None => default
|
||||
match *self {
|
||||
Pref::NoDefault(ref x) => x,
|
||||
Pref::WithDefault(ref default, ref override_value) => {
|
||||
match *override_value {
|
||||
Some(ref x) => x,
|
||||
None => default
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,11 +101,11 @@ impl Pref {
|
|||
fn set(&mut self, value: PrefValue) {
|
||||
// TODO - this should error if we try to override a pref of one type
|
||||
// with a value of a different type
|
||||
match self {
|
||||
&mut Pref::NoDefault(ref mut pref_value) => {
|
||||
match *self {
|
||||
Pref::NoDefault(ref mut pref_value) => {
|
||||
*pref_value = Arc::new(value)
|
||||
},
|
||||
&mut Pref::WithDefault(_, ref mut override_value) => {
|
||||
Pref::WithDefault(_, ref mut override_value) => {
|
||||
*override_value = Some(Arc::new(value))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue