Skip to content

Commit 837c379

Browse files
fixup! Add DynStorageAlloc using FnOnce
1 parent c58fd7c commit 837c379

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/object_safe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ impl dyn DynStorage + '_ {
247247
///
248248
/// This extension trait uses owned `FnOnce` callbacks instead of references to `FnMut`.
249249
pub trait DynStorageAlloc: DynStorage {
250-
fn mount_and_then_unit_boxed(&mut self, f: BoxedFilesystemCallback<'_>) -> Result<()>;
250+
fn mount_and_then_unit_once(&mut self, f: BoxedFilesystemCallback<'_>) -> Result<()>;
251251
}
252252

253253
#[cfg(feature = "alloc")]
254254
impl<T: Storage> DynStorageAlloc for T {
255-
fn mount_and_then_unit_boxed(&mut self, f: BoxedFilesystemCallback<'_>) -> Result<()> {
255+
fn mount_and_then_unit_once(&mut self, f: BoxedFilesystemCallback<'_>) -> Result<()> {
256256
Filesystem::mount_and_then(self, |fs| f(fs))
257257
}
258258
}
@@ -264,7 +264,7 @@ impl dyn DynStorageAlloc + '_ {
264264
F: FnOnce(&dyn DynFilesystem) -> Result<R>,
265265
{
266266
let mut result = Err(Error::IO);
267-
self.mount_and_then_unit_boxed(alloc::boxed::Box::new(|fs| {
267+
self.mount_and_then_unit_once(alloc::boxed::Box::new(|fs| {
268268
result = Ok(f(fs)?);
269269
Ok(())
270270
}))?;

0 commit comments

Comments
 (0)