Skip to content

Commit 530f863

Browse files
committed
Add comment about file deletion!
also clippy
1 parent cac182e commit 530f863

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/store/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ async fn export_path_impl(
12501250
),
12511251
DataLocation::External(paths, size) => (
12521252
MemOrFile::File((
1253-
paths.iter().cloned().next().ok_or_else(|| {
1253+
paths.first().cloned().ok_or_else(|| {
12541254
io::Error::new(io::ErrorKind::NotFound, "no external data path")
12551255
})?,
12561256
size,
@@ -1304,14 +1304,14 @@ async fn export_path_impl(
13041304
if cause.raw_os_error() == Some(ERR_CROSS) {
13051305
reflink_or_copy_with_progress(&source_path, &target, size, tx)
13061306
.await?;
1307-
// todo: delete file at source_path
13081307
} else {
13091308
return Err(cause.into());
13101309
}
13111310
}
13121311
}
13131312
external.push(target);
13141313
};
1314+
// setting the new entry state will also take care of deleting the owned data file!
13151315
ctx.set(EntryState::Complete {
13161316
data_location: DataLocation::External(external, size),
13171317
outboard_location,

0 commit comments

Comments
 (0)