mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Making map+clone more succinct with cloned
This commit is contained in:
parent
48887acff1
commit
de2060e6a1
3 changed files with 6 additions and 5 deletions
|
@ -106,9 +106,10 @@ impl StorageManager {
|
|||
index: u32) {
|
||||
let origin = self.origin_as_string(url);
|
||||
let data = self.select_data(storage_type);
|
||||
sender.send(data.get(&origin)
|
||||
.and_then(|&(_, ref entry)| entry.keys().nth(index as usize))
|
||||
.map(|key| key.clone())).unwrap();
|
||||
let key = data.get(&origin)
|
||||
.and_then(|&(_, ref entry)| entry.keys().nth(index as usize))
|
||||
.cloned();
|
||||
sender.send(key).unwrap();
|
||||
}
|
||||
|
||||
fn keys(&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue