@@ -261,6 +261,12 @@ where
261
261
/// Close a directory. You cannot perform operations on an open directory
262
262
/// and so must close it if you want to do something with it.
263
263
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
+
264
270
// Unwrap, because we should never be in a situation where we're attempting to close a dir
265
271
// with an ID which doesn't exist in our open dirs list.
266
272
let idx_to_close = cluster_position_by_id ( & self . open_dirs , dir. search_id ) . unwrap ( ) ;
@@ -665,6 +671,12 @@ where
665
671
666
672
/// Close a file with the given full path.
667
673
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
+
668
680
// Unwrap, because we should never be in a situation where we're attempting to close a file
669
681
// with an ID which doesn't exist in our open files list.
670
682
let idx_to_close = cluster_position_by_id ( & self . open_files , file. search_id ) . unwrap ( ) ;
0 commit comments