Skip to content

Commit

Permalink
Fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 15, 2024
1 parent 63951b2 commit d113aa1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ fn migrate_single(fs: &dyn DynFilesystem, path: &Path) -> Result<(), Error> {
/// ```
pub fn migrate(fs: &dyn DynFilesystem, apps: &[&Path]) -> Result<(), Error> {
for p in once(&path!("/")).chain(apps) {
migrate_single(fs, *p)?;
migrate_single(fs, p)?;
}
Ok(())
}

#[allow(clippy::unwrap_used)]
#[cfg(test)]
mod tests {
use littlefs2::{fs::Filesystem, ram_storage};
Expand Down Expand Up @@ -81,12 +82,12 @@ mod tests {
fn test_fs_equality(fs: &dyn DynFilesystem, value: &FsValues, path: &Path) {
match value {
FsValues::Dir(d) => {
let mut expected_iter = d.into_iter();
let mut expected_iter = d.iter();
fs.read_dir_and_then(path, &mut |dir| {
// skip . and ..
dir.next().unwrap().unwrap();
dir.next().unwrap().unwrap();
while let Some((expected_path, expected_values)) = expected_iter.next() {
for (expected_path, expected_values) in expected_iter.by_ref() {
let entry = dir.next().unwrap().unwrap();
assert_eq!(entry.file_name(), *expected_path);
test_fs_equality(fs, expected_values, &path.join(expected_path));
Expand Down

0 comments on commit d113aa1

Please sign in to comment.