mirror of
https://github.com/trussed-dev/littlefs2.git
synced 2026-03-11 16:30:52 -07:00
9680d4f583
Our DynStorage trait uses a &mut dyn FnMut as a callback for implementing mount_and_then (instead of a FnOnce like Filesystem). This is because there is no no-std way to pass a FnOnce in an dyn compatible trait method. If alloc is available, this limitation can be avoided by using a Box<dyn FnOnce>. This patch adds an alloc feature to the crate and a DynStorageAlloc trait behind that feature that provides mount_and_then functions using a boxed FnOnce instead of a reference to an FnMut.