The Storage trait is not object safe, and the File and Filesystem struct
have the Storage implementation as a type parameter. This can make it
hard to write code that works with multiple storage implementations, and
it can also lead to increased binary size as the filesystem operations
are monomorphized for all storage implementations.
This patch introduces three new traits, DynFile, DynFilesystem and
DynStorage, that are object-safe wrappers for the File, Filesystem and
Storage types. Some functionality cannot be expressed directly in these
traits and is moved into helper functions instead, e. g. callbacks with
arbitrary return types or methods using const generics.
This PR adds a check in the remove_dir_all method to avoid removing the root directory.
This Gives a simple fix to the case where one wants to remove all files in the filesystem,
and therefore calls remove_dir_all on `/`, which would previously fail because it can't delete the root.
Fixes#35
`remove_dir_all_where` correctly handles the case where a file in the directory was skipped, but not if a subdirectory was skipped.
This commit fixes it
This patch replaces the LOOKAHEADWORDS_SIZE in driver::Storage (measured
in 4 bytes) with LOOKAHEAD_SIZE (measure in 8 bytes). This makes it
impossible to set illegal values.