Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc warnings #52

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait Storage {

/// Size of an erasable block in bytes, as unsigned typenum.
/// Must be a multiple of both `READ_SIZE` and `WRITE_SIZE`.
/// At least 128 (https://git.io/JeHp9). Stored in superblock.
/// [At least 128](https://github.com/littlefs-project/littlefs/issues/264#issuecomment-519963153). Stored in superblock.
const BLOCK_SIZE: usize;

/// Number of erasable blocks.
Expand Down
11 changes: 1 addition & 10 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,16 +706,7 @@ impl<'a, 'b, Storage: driver::Storage> File<'a, 'b, Storage> {
/// Sync the file and drop it from the internal linked list.
/// Not doing this is UB, which is why we have all the closure-based APIs.
///
/// TODO: check if this can be closed >1 times, if so make it safe
///
/// Update: It seems like there's an assertion on a flag called `LFS_F_OPENED`:
/// https://github.com/littlefs-project/littlefs/blob/4c9146ea539f72749d6cc3ea076372a81b12cb11/lfs.c#L2549
/// https://github.com/littlefs-project/littlefs/blob/4c9146ea539f72749d6cc3ea076372a81b12cb11/lfs.c#L2566
///
/// - On second call, shouldn't find ourselves in the "mlist of mdirs"
/// - Since we don't have dynamically allocated buffers, at least we don't hit the double-free.
/// - Not sure what happens in `lfs_file_sync`, but it should be easy to just error on
/// not LFS_F_OPENED...
/// This must not be called twice.
pub unsafe fn close(self) -> Result<()> {
let return_code = ll::lfs_file_close(
&mut self.fs.alloc.borrow_mut().state,
Expand Down
2 changes: 1 addition & 1 deletion src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl SeekFrom {

/// Enumeration of possible methods to seek within an file that was just opened
/// Used in the [`read_chunk`](crate::fs::Filesystem::read_chunk) and [`write_chunk`](crate::fs::Filesystem::write_chunk) methods,
/// Where [`SeekFrom::Current`](SeekFrom::Current) would not make sense.
/// Where [`SeekFrom::Current`] would not make sense.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum OpenSeekFrom {
Start(u32),
Expand Down
2 changes: 1 addition & 1 deletion src/object_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl dyn DynFile + '_ {
/// Object-safe trait for [`Filesystem`][].
///
/// It contains these additional methods from [`Path`][]:
/// - [`DynStorage::exists`][]
/// - [`DynFilesystem::exists`][]
///
/// The following methods are implemented in [`DynStorage`][] instead:
/// - [`DynStorage::format`][]
Expand Down
Loading