Skip to content

Commit

Permalink
refactor(Storage): Allow unused mut variable for other platforms diff…
Browse files Browse the repository at this point in the history
…erent from Linux
  • Loading branch information
lgmarchi committed Mar 28, 2023
1 parent 8c0e8d4 commit d729bb2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ui/src/layouts/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,13 +852,16 @@ async fn drag_and_drop_function(
}
}

#[cfg(target_os = "linux")]
pub fn decoded_pathbufs(paths: Vec<PathBuf>) -> Vec<PathBuf> {
#[allow(unused_mut)]
let mut paths = paths.clone();
let decode = |path: &Path| path.as_os_str().to_string_lossy().replace("%20", " ");
paths = paths
.iter()
.map(|p| PathBuf::from(decode(p)))
.collect::<Vec<PathBuf>>();
#[cfg(target_os = "linux")]
{
let decode = |path: &Path| path.as_os_str().to_string_lossy().replace("%20", " ");
paths = paths
.iter()
.map(|p| PathBuf::from(decode(p)))
.collect::<Vec<PathBuf>>();
}
paths
}

0 comments on commit d729bb2

Please sign in to comment.