Skip to content

Commit

Permalink
servo: Merge #5576 - net/storage_task.rs: Fix remove_item (from jagta…
Browse files Browse the repository at this point in the history
…lon:jag/slashdot-storage); r=jdm

Use `and_then` and remove `unwrap` instead of using a `map` as described in servo/servo#5548 (comment).

Fixes #5548

Source-Repo: https://github.com/servo/servo
Source-Revision: 9754c4c255988475d12a9c64a335d9bc8828076b

UltraBlame original commit: acb172dc8353e4e88c8ae12ac3ff3c2703154275
  • Loading branch information
marco-c committed Oct 1, 2019
1 parent de35849 commit 9df584e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 5 deletions.
6 changes: 1 addition & 5 deletions servo/components/net/storage_task.rs
Expand Up @@ -965,7 +965,7 @@ get_mut
origin
)
.
map
and_then
(
|
entry
Expand All @@ -980,10 +980,6 @@ name
)
}
)
.
unwrap
(
)
;
sender
.
Expand Down
76 changes: 76 additions & 0 deletions servo/tests/content/test_storage.html
@@ -0,0 +1,76 @@
<
html
>
<
head
>
<
title
>
<
/
title
>
<
script
src
=
"
harness
.
js
"
>
<
/
script
>
<
/
head
>
<
body
>
<
script
>
/
/
Delete
keys
that
don
'
t
exist
in
either
localStorage
/
/
or
sessionStorage
.
delete
localStorage
.
a
;
delete
sessionStorage
.
a
;
<
/
script
>
<
/
body
>
<
/
html
>

0 comments on commit 9df584e

Please sign in to comment.