Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Mar 10, 2023
1 parent 72a977b commit 6564fff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,10 @@ impl<'a, 'b, Storage: driver::Storage> File<'a, 'b, Storage> {
io::result_from(return_code as usize, return_code)
}

pub fn is_empty(&self) -> Result<bool> {
self.len().map(|l| l == 0)
}

/// Truncates or extends the underlying file, updating the size of this file to become size.
///
/// If the size is less than the current file's size, then the file will be shrunk. If it is
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![cfg_attr(not(test), no_std)]
// FIXME
#![allow(clippy::missing_safety_doc)]

/*!
Expand Down
6 changes: 6 additions & 0 deletions src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ unsafe fn strlen(mut s: *const c_char) -> size_t {
n
}

impl Default for PathBuf {
fn default() -> Self {
Self::new()
}
}

impl PathBuf {
pub fn new() -> Self {
Self {
Expand Down

0 comments on commit 6564fff

Please sign in to comment.