mount_or_else: give access to allocation in callback

This commit is contained in:
Sosthène Guédon
2025-05-14 10:16:21 +02:00
committed by sosthene-nitrokey
parent a37ba04ce8
commit 4f86dc4f8f
+2 -2
View File
@@ -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)