Optimized code and performance using clippy

This commit is contained in:
ChristianVisintin
2020-12-12 12:14:51 +01:00
parent 0eae159bb9
commit 55bda874f0
16 changed files with 716 additions and 772 deletions

View File

@@ -199,7 +199,7 @@ impl LogRecord {
pub fn new(level: LogLevel, msg: &str) -> LogRecord {
LogRecord {
time: Local::now(),
level: level,
level,
msg: String::from(msg),
}
}
@@ -243,7 +243,7 @@ impl FileTransferActivity {
FileTransferProtocol::Ftp(ftps) => Box::new(FtpFileTransfer::new(ftps)),
FileTransferProtocol::Scp => Box::new(ScpFileTransfer::new()),
},
params: params,
params,
local: FileExplorer::new(),
remote: FileExplorer::new(),
tab: FileExplorerTab::Local,
@@ -292,10 +292,7 @@ impl Activity for FileTransferActivity {
if self.context.is_none() {
return;
}
let is_explorer_mode: bool = match self.input_mode {
InputMode::Explorer => true,
_ => false,
};
let is_explorer_mode: bool = matches!(self.input_mode, InputMode::Explorer);
// Check if connected
if !self.client.is_connected() && is_explorer_mode {
// Set init state to connecting popup