Skip to content

Commit 85e65c4

Browse files
committed
f Drop unnecessary clone
1 parent c9ec2d6 commit 85e65c4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lightning-persister/src/fs_store.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -417,21 +417,21 @@ fn get_key_from_dir_entry(p: &Path, base_path: &Path) -> Result<String, lightnin
417417

418418
impl MigratableKVStore for FilesystemStore {
419419
fn list_all_keys(&self) -> Result<Vec<(String, String, String)>, lightning::io::Error> {
420-
let prefixed_dest = self.data_dir.clone();
420+
let prefixed_dest = &self.data_dir;
421421
if !prefixed_dest.exists() {
422422
return Ok(Vec::new());
423423
}
424424

425425
let mut keys = Vec::new();
426426

427-
'primary_loop: for primary_entry in fs::read_dir(&prefixed_dest)? {
427+
'primary_loop: for primary_entry in fs::read_dir(prefixed_dest)? {
428428
let primary_entry = primary_entry?;
429429
let primary_path = primary_entry.path();
430430

431431
if dir_entry_is_key(&primary_path)? {
432432
let primary_namespace = "".to_string();
433433
let secondary_namespace = "".to_string();
434-
let key = get_key_from_dir_entry(&primary_path, &prefixed_dest)?;
434+
let key = get_key_from_dir_entry(&primary_path, prefixed_dest)?;
435435
keys.push((primary_namespace, secondary_namespace, key));
436436
continue 'primary_loop;
437437
}
@@ -442,7 +442,7 @@ impl MigratableKVStore for FilesystemStore {
442442
let secondary_path = secondary_entry.path();
443443

444444
if dir_entry_is_key(&secondary_path)? {
445-
let primary_namespace = get_key_from_dir_entry(&primary_path, &prefixed_dest)?;
445+
let primary_namespace = get_key_from_dir_entry(&primary_path, prefixed_dest)?;
446446
let secondary_namespace = "".to_string();
447447
let key = get_key_from_dir_entry(&secondary_path, &primary_path)?;
448448
keys.push((primary_namespace, secondary_namespace, key));
@@ -456,7 +456,7 @@ impl MigratableKVStore for FilesystemStore {
456456

457457
if dir_entry_is_key(&tertiary_path)? {
458458
let primary_namespace =
459-
get_key_from_dir_entry(&primary_path, &prefixed_dest)?;
459+
get_key_from_dir_entry(&primary_path, prefixed_dest)?;
460460
let secondary_namespace =
461461
get_key_from_dir_entry(&secondary_path, &primary_path)?;
462462
let key = get_key_from_dir_entry(&tertiary_path, &secondary_path)?;

0 commit comments

Comments
 (0)