File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ impl KVStore for FilesystemStore {
86
86
std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidInput , msg)
87
87
} ) ?
88
88
. to_path_buf ( ) ;
89
- fs:: create_dir_all ( parent_directory. clone ( ) ) ?;
89
+ fs:: create_dir_all ( & parent_directory) ?;
90
90
91
91
// Do a crazy dance with lots of fsync()s to be overly cautious here...
92
92
// We never want to end up in a state where we've lost the old data, or end up using the
@@ -106,7 +106,7 @@ impl KVStore for FilesystemStore {
106
106
#[ cfg( not( target_os = "windows" ) ) ]
107
107
{
108
108
fs:: rename ( & tmp_file_path, & dest_file_path) ?;
109
- let dir_file = fs:: OpenOptions :: new ( ) . read ( true ) . open ( parent_directory. clone ( ) ) ?;
109
+ let dir_file = fs:: OpenOptions :: new ( ) . read ( true ) . open ( & parent_directory) ?;
110
110
unsafe {
111
111
libc:: fsync ( dir_file. as_raw_fd ( ) ) ;
112
112
}
@@ -206,7 +206,7 @@ impl KVStore for FilesystemStore {
206
206
return Ok ( Vec :: new ( ) ) ;
207
207
}
208
208
209
- for entry in fs:: read_dir ( prefixed_dest. clone ( ) ) ? {
209
+ for entry in fs:: read_dir ( & prefixed_dest) ? {
210
210
let entry = entry?;
211
211
let p = entry. path ( ) ;
212
212
@@ -220,7 +220,7 @@ impl KVStore for FilesystemStore {
220
220
}
221
221
}
222
222
223
- if let Ok ( relative_path) = p. strip_prefix ( prefixed_dest. clone ( ) ) {
223
+ if let Ok ( relative_path) = p. strip_prefix ( & prefixed_dest) {
224
224
keys. push ( relative_path. display ( ) . to_string ( ) )
225
225
}
226
226
}
You can’t perform that action at this time.
0 commit comments