diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-08-30 12:16:44 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-08-30 12:16:44 +0200 |
commit | 5889c1298dd062a94482451bd3c989f1aec67db6 (patch) | |
tree | 6bddd5099f6f02398c513c83c296b49df0b3657f /src/repository/fs | |
parent | 406718822b4dddd635df6a62128bf2228db9248e (diff) |
Fix clippy: Use or_insert_with() for less runtime cost
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/repository/fs')
-rw-r--r-- | src/repository/fs/representation.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repository/fs/representation.rs b/src/repository/fs/representation.rs index 991d791..6a57a38 100644 --- a/src/repository/fs/representation.rs +++ b/src/repository/fs/representation.rs @@ -87,7 +87,7 @@ impl FileSystemRepresentation { }, dir @ PathComponent::DirName(_) => { curr_hm.entry(dir.clone()) - .or_insert(Element::Dir(HashMap::new())); + .or_insert_with(|| Element::Dir(HashMap::new())); curr_hm = curr_hm.get_mut(&dir) .unwrap() // safe, because we just inserted it |