Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading