mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Clippy rust 1.52
This commit is contained in:
@@ -185,9 +185,8 @@ impl FtpFileTransfer {
|
|||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
// Get symlink
|
// Get symlink
|
||||||
let symlink: Option<Box<FsEntry>> = match symlink_path {
|
let symlink: Option<Box<FsEntry>> = symlink_path.map(|p| {
|
||||||
None => None,
|
Box::new(match p.to_string_lossy().ends_with('/') {
|
||||||
Some(p) => Some(Box::new(match p.to_string_lossy().ends_with('/') {
|
|
||||||
true => {
|
true => {
|
||||||
// NOTE: is_dir becomes true
|
// NOTE: is_dir becomes true
|
||||||
is_dir = true;
|
is_dir = true;
|
||||||
@@ -226,8 +225,8 @@ impl FtpFileTransfer {
|
|||||||
group: gid,
|
group: gid,
|
||||||
unix_pex: Some(unix_pex),
|
unix_pex: Some(unix_pex),
|
||||||
}),
|
}),
|
||||||
})),
|
})
|
||||||
};
|
});
|
||||||
let mut abs_path: PathBuf = PathBuf::from(path);
|
let mut abs_path: PathBuf = PathBuf::from(path);
|
||||||
abs_path.push(file_name.as_str());
|
abs_path.push(file_name.as_str());
|
||||||
let abs_path: PathBuf = Self::resolve(abs_path.as_path());
|
let abs_path: PathBuf = Self::resolve(abs_path.as_path());
|
||||||
|
|||||||
@@ -327,10 +327,7 @@ impl FileTransferActivity {
|
|||||||
|
|
||||||
pub(super) fn action_remote_rename(&mut self, input: String) {
|
pub(super) fn action_remote_rename(&mut self, input: String) {
|
||||||
if let Some(idx) = self.get_remote_file_idx() {
|
if let Some(idx) = self.get_remote_file_idx() {
|
||||||
let entry = match self.remote().get(idx) {
|
let entry = self.remote().get(idx).cloned();
|
||||||
None => None,
|
|
||||||
Some(e) => Some(e.clone()),
|
|
||||||
};
|
|
||||||
if let Some(entry) = entry {
|
if let Some(entry) = entry {
|
||||||
let dst_path: PathBuf = PathBuf::from(input);
|
let dst_path: PathBuf = PathBuf::from(input);
|
||||||
let full_path: PathBuf = entry.get_abs_path();
|
let full_path: PathBuf = entry.get_abs_path();
|
||||||
@@ -390,10 +387,7 @@ impl FileTransferActivity {
|
|||||||
pub(super) fn action_remote_delete(&mut self) {
|
pub(super) fn action_remote_delete(&mut self) {
|
||||||
if let Some(idx) = self.get_remote_file_idx() {
|
if let Some(idx) = self.get_remote_file_idx() {
|
||||||
// Check if file entry exists
|
// Check if file entry exists
|
||||||
let entry = match self.remote().get(idx) {
|
let entry = self.remote().get(idx).cloned();
|
||||||
None => None,
|
|
||||||
Some(e) => Some(e.clone()),
|
|
||||||
};
|
|
||||||
if let Some(entry) = entry {
|
if let Some(entry) = entry {
|
||||||
let full_path: PathBuf = entry.get_abs_path();
|
let full_path: PathBuf = entry.get_abs_path();
|
||||||
// Delete file
|
// Delete file
|
||||||
|
|||||||
Reference in New Issue
Block a user