split rtc module out to reduce repreated exactly same code
This commit is contained in:
@@ -240,14 +240,6 @@ impl Esp<'_> {
|
||||
println!("Wrote config config {:?}", config);
|
||||
anyhow::Ok(())
|
||||
}
|
||||
pub(crate) fn delete_config(&self) -> anyhow::Result<()> {
|
||||
let config = Path::new(Self::CONFIG_FILE);
|
||||
if config.exists() {
|
||||
println!("Removing config");
|
||||
fs::remove_file(config)?
|
||||
}
|
||||
anyhow::Ok(())
|
||||
}
|
||||
pub(crate) fn mount_file_system(&mut self) -> anyhow::Result<()> {
|
||||
log(LogMessage::MountingFilesystem, 0, 0, "", "");
|
||||
let base_path = CString::new("/spiffs")?;
|
||||
@@ -308,10 +300,7 @@ impl Esp<'_> {
|
||||
OkStd(file) => {
|
||||
let f = FileInfo {
|
||||
filename: file.file_name().into_string().unwrap(),
|
||||
size: file
|
||||
.metadata()
|
||||
.map(|it| it.len())
|
||||
.unwrap_or_default()
|
||||
size: file.metadata().map(|it| it.len()).unwrap_or_default()
|
||||
as usize,
|
||||
};
|
||||
result.push(f);
|
||||
|
Reference in New Issue
Block a user