Skip to content

Commit

Permalink
Fix doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 5, 2024
1 parent 8a1fa49 commit c2876ed
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
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

0 comments on commit c2876ed

Please sign in to comment.