Skip to content

Commit 9204826

Browse files
Clean up warning about unused argument.
1 parent 13d0cc1 commit 9204826

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/volume_mgr.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ where
261261
/// Close a directory. You cannot perform operations on an open directory
262262
/// and so must close it if you want to do something with it.
263263
pub fn close_dir(&mut self, volume: &Volume, dir: Directory) {
264+
// We don't strictly speaking need the volume in order to close a
265+
// directory, as we don't flush anything to disk at this point. The open
266+
// directory acts more as a lock. However, we take it because it then
267+
// matches the `close_file` API.
268+
let _ = volume;
269+
264270
// Unwrap, because we should never be in a situation where we're attempting to close a dir
265271
// with an ID which doesn't exist in our open dirs list.
266272
let idx_to_close = cluster_position_by_id(&self.open_dirs, dir.search_id).unwrap();
@@ -665,6 +671,12 @@ where
665671

666672
/// Close a file with the given full path.
667673
pub fn close_file(&mut self, volume: &Volume, file: File) -> Result<(), Error<D::Error>> {
674+
// We don't strictly speaking need the volume in order to close a
675+
// directory, as we don't flush anything to disk at this point. However,
676+
// we take it in case we change this in the future and closing a file
677+
// does then cause some disk write to occur.
678+
let _ = volume;
679+
668680
// Unwrap, because we should never be in a situation where we're attempting to close a file
669681
// with an ID which doesn't exist in our open files list.
670682
let idx_to_close = cluster_position_by_id(&self.open_files, file.search_id).unwrap();

0 commit comments

Comments
 (0)