diff --git a/libconfig/src/lib.rs b/libconfig/src/lib.rs index 0378e5f..0b42072 100644 --- a/libconfig/src/lib.rs +++ b/libconfig/src/lib.rs @@ -2,7 +2,7 @@ extern crate alloc; use core::fmt; -use alloc::{string::FromUtf8Error, string::String, vec::Vec, rc::Rc}; +use alloc::{string::FromUtf8Error, string::String, vec::Vec, rc::Rc, str}; use core_io::{self as io, BufRead, BufReader, Read, Write, Seek, ErrorKind, SeekFrom}; use libboard_zynq::sdio; @@ -163,7 +163,7 @@ impl Config { let dir = root_dir.create_dir("/CONFIG")?; for r in dir.iter() { let entry = r?; - if entry.isfile() { + if entry.is_file() { dir.remove(str::from_utf8(entry.short_file_name_as_bytes()).unwrap())?; } } @@ -227,6 +227,7 @@ impl Config { pub fn remove<'b>(&mut self, key: &str) -> Result<'b, ()>{ self.remove_config_txt(key)?; self.remove_config_key_bin(key)?; + Ok(()) } pub fn write_str<'b>(&mut self, key: &str, data: &str) -> Result<'b, ()>{ if let Some(fs) = &self.fs {