Commit Graph
103 Commits
Author SHA1 Message Date
Sosthène Guédon 4886c47952 Fix doc warnings 2024-02-05 09:37:51 +01:00
Sosthène Guédonandsosthene-nitrokey 8a1fa499bb Fix clippy warnings 2024-02-05 09:37:35 +01:00
Robin Krahl ebd27e49ca Add object-safe traits for File, Filesystem, Storage
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.
2023-12-15 16:48:02 +01:00
Sosthène Guédonandsosthene-nitrokey 9c2d48d5c5 Update changelog 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey 3715f46d2a Improve readability of file_name 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey da6d4bb0a1 Add documentation 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey 3d81094751 Add file_name function 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey 47ef5f5859 Fix clippy warning 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey 04b3519fee path: add ancestors iterator 2023-11-15 15:09:52 +01:00
Sosthène Guédonandsosthene-nitrokey ae57c29931 Fix deletion of root directory
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.
2023-09-05 10:03:17 +02:00
Sosthène Guédonandsosthene-nitrokey 8eb6b4ec48 Fix crashes when run with littlefs assertions 2023-06-23 15:37:56 +02:00
Sosthène Guédonandsosthene-nitrokey ec304b8663 Add chunked file API 2023-06-12 11:07:14 +02:00
Sosthène Guédonandsosthene-nitrokey 154e054329 Fix recursion handling in remove_dir_all_where
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
2023-06-12 10:47:18 +02:00
Sosthène Guédonandsosthene-nitrokey b1ac5c3757 Fix clippy warnings 2023-06-12 10:47:18 +02:00
Sosthène Guédonandsosthene-nitrokey a5f6e38a95 Run cargo clippy --fix 2023-06-12 10:47:18 +02:00
Sosthène Guédonandsosthene-nitrokey 9fde6f06fc Run cargo fmt 2023-06-12 10:47:18 +02:00
Matt SullivanandRobin Krahl 8019e8ad6d - Remove use-statement from previous commit.
- Add changelog entry.
2023-04-21 18:32:26 +02:00
Matt SullivanandRobin Krahl a3ec29efba Fix typecast in Metadata::from implementation. 2023-04-21 18:32:26 +02:00
Lachezar LechevandRobin Krahl 0a66788666 ci: add builds for more targets & update checkout
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-04-21 18:26:30 +02:00
Lachezar LechevandRobin Krahl 8ed5ea2e5b fix: Update urls and docs for:
- Urls to former users
- badges
- upstream release

Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
2023-04-21 18:26:30 +02:00
Robin Krahl f906960d56 Fix macro hygiene for path! 2023-04-20 16:23:15 +02:00
Nicolas Stalder fd178ba1d4 Fix up Cargo.toml 0.4.0 2023-02-07 18:00:21 +01:00
Robin KrahlandNicolas Stalder 6b02d54bcf Release v0.4.0 2023-02-07 17:59:09 +01:00
Robin Krahl ad3b40b896 Remove rust-toolchain.toml
As we fixed the lookahead buffer overflow, we no longer have to pin the
Rust version.

Fixes https://github.com/trussed-dev/littlefs2/issues/26
Fixes https://github.com/trussed-dev/littlefs2/issues/28
2023-02-07 10:01:42 +01:00
Robin Krahl 2f396cc0bc Replace LOOKAHEADWORDS_SIZE with LOOKAHEAD_SIZE
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.
2023-02-07 10:01:42 +01:00