mirror of
https://github.com/trussed-dev/littlefs2.git
synced 2026-06-20 04:16:32 -07:00
mount_or_else: give access to allocation in callback
This commit is contained in:
committed by
sosthene-nitrokey
parent
a37ba04ce8
commit
4f86dc4f8f
@@ -1111,11 +1111,11 @@ impl<'a, Storage: driver::Storage> Filesystem<'a, Storage> {
|
||||
f: F,
|
||||
) -> Result<Self>
|
||||
where
|
||||
F: FnOnce(Error, &mut Storage) -> Result<()>,
|
||||
F: FnOnce(Error, &mut Storage, &mut Allocation<Storage>) -> Result<()>,
|
||||
{
|
||||
let fs = Self::new(alloc, storage);
|
||||
if let Err(err) = fs.raw_mount() {
|
||||
f(err, fs.storage)?;
|
||||
f(err, fs.storage, &mut fs.alloc.borrow_mut())?;
|
||||
fs.raw_mount()?;
|
||||
}
|
||||
Ok(fs)
|
||||
|
||||
Reference in New Issue
Block a user