Skip to content

Commit

Permalink
Fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CEbbinghaus committed Sep 26, 2024
1 parent d6af215 commit 2ea7bb2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions backend/src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,25 @@ fn find_mount_name() -> Result<Option<String>, Error> {
continue;
}

let mount = entry.file_name();
let mount: String = match entry.file_name().to_str() {
Some(v) => v.to_owned(),
None => {
error!("Failed to convert mount point to string");
return Ok(None);
}
};
info!(mount = ?mount, "Found MicroSD Card mount label");

// apparently the label will occasionally contain ascii escape characters like \x20
let unescaped = match unescaper::unescape(mount) {
let unescaped = match unescaper::unescape(&mount) {
Ok(v) => v,
Err(err) => {
error!(%err, "Failed to unescape mount point");
return Ok(None);
}
};

if !has_libraryfolder(Some(mount)) {
if !has_libraryfolder(&Some(mount)) {
warn!(
mount = unescaped,
"Mount point does not resolve library folder"
Expand Down

0 comments on commit 2ea7bb2

Please sign in to comment.