The const_ram_storage! and ram_storage! macros used to have trait and
result arguments to set the storage trait to implement and the result
type to use. As this defaulted to relative paths, it made the result of
the macro dependent on the context and could cause confusion. At the
same time, there is no real use case for substituting these types.
This patch removes the arguments for good and just uses
$crate::driver::Storage and $crate::io::Result instead.
This patch replaces the version function with two constants,
BACKEND_VERSION and DISK_VERSION, and changes the Version struct to be
a wrapper for a littlefs version number. DISK_VERSION is now the disk
version used by this crate, not the newest version supported by the
backend.
We already have the path macro and PathBuf::from_path. Having a
separate path_buf macro makes the code more readable and ensures
compile-time evaluation.
Some functions assume that c_int is always i32. This is not true for
all platforms. This patch adapts those functions to handle those cases.
Some littlefs functions return an error code (c_int) from functions
returning i32. In these cases, error codes are truncated to c_int::MIN.
If unwrap or expect is used on a Result<_, Error>, the Debug
implementation is not always optimized out. This leads to a significant
increase of the binary size. As a short-term fix, this patch changes the
Debug implementation to always returns a static string.
The DynFile::read_to_end, DynFilesystem::read and
DynFilesystem::read_chunk methods use a heapless::Vec to store a
flexible amount of data. This patch introduces a Vec trait that
abstracts over different versions of heapless so that we can optionally
support multiple heapless versions at the same time.
Fixes: https://github.com/trussed-dev/littlefs2/issues/77
The dir-entry-path feature has been enabled by default and only adds a
very small overhead. To decrease complexity, this patch removes the
feature and always enables the previously feature-gated code.
Fixes: https://github.com/trussed-dev/littlefs2/issues/76
This patch refactory the API to read and write attributes so that the
buffer is always provided by the caller. This means that the caller is
not required to always use a 1 kB buffer even if the attribute length is
much smaller.
Fixes: https://github.com/trussed-dev/littlefs2/issues/75