File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11#![ cfg_attr( not( test) , no_std) ]
2+ #![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
23// FIXME
34#![ allow( clippy:: missing_safety_doc) ]
45
Original file line number Diff line number Diff line change @@ -243,6 +243,9 @@ impl dyn DynStorage + '_ {
243243}
244244
245245#[ cfg( feature = "alloc" ) ]
246+ /// Extension trait for [`DynStorage`][] that requires `alloc`.
247+ ///
248+ /// This extension trait uses owned `FnOnce` callbacks instead of references to `FnMut`.
246249pub trait DynStorageAlloc : DynStorage {
247250 fn mount_and_then_unit_boxed ( & mut self , f : BoxedFilesystemCallback < ' _ > ) -> Result < ( ) > ;
248251}
@@ -256,7 +259,10 @@ impl<T: Storage> DynStorageAlloc for T {
256259
257260#[ cfg( feature = "alloc" ) ]
258261impl dyn DynStorageAlloc + ' _ {
259- pub fn mount_and_then_boxed < R > ( & mut self , f : BoxedFilesystemCallback < ' _ , R > ) -> Result < R > {
262+ pub fn mount_and_then_once < F , R > ( & mut self , f : F ) -> Result < R >
263+ where
264+ F : FnOnce ( & dyn DynFilesystem ) -> Result < R > ,
265+ {
260266 let mut result = Err ( Error :: IO ) ;
261267 self . mount_and_then_unit_boxed ( alloc:: boxed:: Box :: new ( |fs| {
262268 result = Ok ( f ( fs) ?) ;
You can’t perform that action at this time.
0 commit comments