Remove needless scope

This commit is contained in:
Jeremy Stucki 2019-06-20 14:29:14 +02:00
parent a9dae326fa
commit 3a0eeb4bbb
No known key found for this signature in database
GPG Key ID: EEFCA93148042655
1 changed files with 4 additions and 6 deletions

View File

@ -540,13 +540,11 @@ trait Updateable<'de>: Serialize + Deserialize<'de> {
fn update_value<S: Serialize>(&mut self, key: &str, value: S) {
let mut raw = Value::try_from(&self).expect("unreachable");
{
if let Ok(value) = Value::try_from(value) {
let _ = raw.insert(key, value);
} else {
return;
}
}
if let Ok(updated) = raw.try_into() {
*self = updated;