mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #5576 - jagtalon:jag/slashdot-storage, r=jdm
Use `and_then` and remove `unwrap` instead of using a `map` as described in https://github.com/servo/servo/issues/5548#issuecomment-90254644. Fixes #5548
This commit is contained in:
commit
9754c4c255
2 changed files with 16 additions and 2 deletions
|
@ -133,9 +133,9 @@ impl StorageManager {
|
|||
fn remove_item(&mut self, sender: Sender<Option<DOMString>>, url: Url, storage_type: StorageType, name: DOMString) {
|
||||
let origin = self.get_origin_as_string(url);
|
||||
let data = self.select_data_mut(storage_type);
|
||||
let old_value = data.get_mut(&origin).map(|entry| {
|
||||
let old_value = data.get_mut(&origin).and_then(|entry| {
|
||||
entry.remove(&name)
|
||||
}).unwrap();
|
||||
});
|
||||
sender.send(old_value).unwrap();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue