mirror of
https://github.com/veeso/termscp.git
synced 2026-09-27 06:21:22 -07:00
fix: lint
This commit is contained in:
@@ -162,10 +162,10 @@ impl FileTransferActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_file_from_path(&mut self, id: &Id, path: &Path) -> Option<File> {
|
fn get_file_from_path(&mut self, id: &Id, path: &Path) -> Option<File> {
|
||||||
match id {
|
match *id {
|
||||||
&Id::ExplorerHostBridge => self.host_bridge.stat(path).ok(),
|
Id::ExplorerHostBridge => self.host_bridge.stat(path).ok(),
|
||||||
&Id::ExplorerRemote => self.client.stat(path).ok(),
|
Id::ExplorerRemote => self.client.stat(path).ok(),
|
||||||
&Id::ExplorerFind => {
|
Id::ExplorerFind => {
|
||||||
let found = self.browser.found_tab().unwrap();
|
let found = self.browser.found_tab().unwrap();
|
||||||
match found {
|
match found {
|
||||||
FoundExplorerTab::Local => self.host_bridge.stat(path).ok(),
|
FoundExplorerTab::Local => self.host_bridge.stat(path).ok(),
|
||||||
@@ -177,10 +177,10 @@ impl FileTransferActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn browser_by_id(&self, id: &Id) -> &FileExplorer {
|
fn browser_by_id(&self, id: &Id) -> &FileExplorer {
|
||||||
match id {
|
match *id {
|
||||||
&Id::ExplorerHostBridge => self.host_bridge(),
|
Id::ExplorerHostBridge => self.host_bridge(),
|
||||||
&Id::ExplorerRemote => self.remote(),
|
Id::ExplorerRemote => self.remote(),
|
||||||
&Id::ExplorerFind => self.found().as_ref().unwrap(),
|
Id::ExplorerFind => self.found().as_ref().unwrap(),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,12 +189,7 @@ impl FileTransferActivity {
|
|||||||
let browser = self.browser_by_id(id);
|
let browser = self.browser_by_id(id);
|
||||||
// if no transfer queue, return selected files
|
// if no transfer queue, return selected files
|
||||||
match self.get_selected_index(id) {
|
match self.get_selected_index(id) {
|
||||||
SelectedFileIndex::One(idx) => {
|
SelectedFileIndex::One(idx) => browser.get(idx).cloned(),
|
||||||
let Some(f) = browser.get(idx) else {
|
|
||||||
return None;
|
|
||||||
};
|
|
||||||
Some(f.clone())
|
|
||||||
}
|
|
||||||
SelectedFileIndex::None => None,
|
SelectedFileIndex::None => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ impl FileTransferActivity {
|
|||||||
// Send recurse
|
// Send recurse
|
||||||
let result = entries
|
let result = entries
|
||||||
.iter()
|
.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())
|
.find(|x| x.is_err())
|
||||||
.unwrap_or(Ok(()));
|
.unwrap_or(Ok(()));
|
||||||
// Umount progress bar
|
// Umount progress bar
|
||||||
@@ -782,7 +782,7 @@ impl FileTransferActivity {
|
|||||||
// Send recurse
|
// Send recurse
|
||||||
let result = entries
|
let result = entries
|
||||||
.iter()
|
.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())
|
.find(|x| x.is_err())
|
||||||
.unwrap_or(Ok(()));
|
.unwrap_or(Ok(()));
|
||||||
// Umount progress bar
|
// Umount progress bar
|
||||||
|
|||||||
Reference in New Issue
Block a user