fix: lint

This commit is contained in:
veeso
2025-03-22 15:32:03 +01:00
parent 09bc29fcef
commit 76c5528734
2 changed files with 11 additions and 16 deletions

View File

@@ -162,10 +162,10 @@ impl FileTransferActivity {
}
fn get_file_from_path(&mut self, id: &Id, path: &Path) -> Option<File> {
match id {
&Id::ExplorerHostBridge => self.host_bridge.stat(path).ok(),
&Id::ExplorerRemote => self.client.stat(path).ok(),
&Id::ExplorerFind => {
match *id {
Id::ExplorerHostBridge => self.host_bridge.stat(path).ok(),
Id::ExplorerRemote => self.client.stat(path).ok(),
Id::ExplorerFind => {
let found = self.browser.found_tab().unwrap();
match found {
FoundExplorerTab::Local => self.host_bridge.stat(path).ok(),
@@ -177,10 +177,10 @@ impl FileTransferActivity {
}
fn browser_by_id(&self, id: &Id) -> &FileExplorer {
match id {
&Id::ExplorerHostBridge => self.host_bridge(),
&Id::ExplorerRemote => self.remote(),
&Id::ExplorerFind => self.found().as_ref().unwrap(),
match *id {
Id::ExplorerHostBridge => self.host_bridge(),
Id::ExplorerRemote => self.remote(),
Id::ExplorerFind => self.found().as_ref().unwrap(),
_ => unreachable!(),
}
}
@@ -189,12 +189,7 @@ impl FileTransferActivity {
let browser = self.browser_by_id(id);
// if no transfer queue, return selected files
match self.get_selected_index(id) {
SelectedFileIndex::One(idx) => {
let Some(f) = browser.get(idx) else {
return None;
};
Some(f.clone())
}
SelectedFileIndex::One(idx) => browser.get(idx).cloned(),
SelectedFileIndex::None => None,
}
}

View File

@@ -350,7 +350,7 @@ impl FileTransferActivity {
// Send recurse
let result = entries
.iter()
.map(|(x, remote)| self.filetransfer_send_recurse(x, &remote, None))
.map(|(x, remote)| self.filetransfer_send_recurse(x, remote, None))
.find(|x| x.is_err())
.unwrap_or(Ok(()));
// Umount progress bar
@@ -782,7 +782,7 @@ impl FileTransferActivity {
// Send recurse
let result = entries
.iter()
.map(|(x, path)| self.filetransfer_recv_recurse(x, &path, None))
.map(|(x, path)| self.filetransfer_recv_recurse(x, path, None))
.find(|x| x.is_err())
.unwrap_or(Ok(()));
// Umount progress bar