mirror of
https://codeberg.org/icewind/palantir.git
synced 2026-06-03 10:14:09 +02:00
updates
This commit is contained in:
parent
40560f2129
commit
22c82c59af
7 changed files with 926 additions and 924 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use std::fs::{read_dir, read_to_string, File};
|
||||
use std::fs::{File, read_dir, read_to_string};
|
||||
use std::io;
|
||||
use std::io::{ErrorKind, Read, Seek};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
|
@ -26,9 +26,8 @@ impl FileSource {
|
|||
Ok(FileSource {
|
||||
path: path.into(),
|
||||
buff: String::with_capacity(32),
|
||||
file: File::open(path).map_err(|e| {
|
||||
file: File::open(path).inspect_err(|_| {
|
||||
warn!("failed to open sensor {}", path.display());
|
||||
e
|
||||
})?,
|
||||
})
|
||||
}
|
||||
|
|
@ -66,9 +65,8 @@ impl FileSource {
|
|||
}
|
||||
|
||||
pub fn reopen(&mut self) -> io::Result<()> {
|
||||
self.file = File::open(&self.path).map_err(|e| {
|
||||
self.file = File::open(&self.path).inspect_err(|_| {
|
||||
warn!("failed to open sensor {}", self.path.display());
|
||||
e
|
||||
})?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue