Skip to content

Commit

Permalink
Fix some new clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege authored and bilelmoussaoui committed Jan 10, 2025
1 parent ced2343 commit 27f64cd
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions glib/src/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1441,14 +1441,8 @@ where

for i in 0..variant.n_children() {
let entry = variant.child_value(i);
let key = match entry.child_value(0).get() {
Some(key) => key,
None => return None,
};
let val = match entry.child_value(1).get() {
Some(val) => val,
None => return None,
};
let key = entry.child_value(0).get()?;
let val = entry.child_value(1).get()?;

map.insert(key, val);
}
Expand All @@ -1471,14 +1465,8 @@ where

for i in 0..variant.n_children() {
let entry = variant.child_value(i);
let key = match entry.child_value(0).get() {
Some(key) => key,
None => return None,
};
let val = match entry.child_value(1).get() {
Some(val) => val,
None => return None,
};
let key = entry.child_value(0).get()?;
let val = entry.child_value(1).get()?;

map.insert(key, val);
}
Expand Down Expand Up @@ -1646,14 +1634,8 @@ where
return None;
}

let key = match variant.child_value(0).get() {
Some(key) => key,
None => return None,
};
let value = match variant.child_value(1).get() {
Some(value) => value,
None => return None,
};
let key = variant.child_value(0).get()?;
let value = variant.child_value(1).get()?;

Some(Self { key, value })
}
Expand Down

0 comments on commit 27f64cd

Please sign in to comment.