mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
lint
This commit is contained in:
@@ -60,14 +60,14 @@ pub enum Id {
|
||||
WindowSizeError,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
pub enum Msg {
|
||||
Form(FormMsg),
|
||||
Ui(UiMsg),
|
||||
None,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum FormMsg {
|
||||
Connect,
|
||||
DeleteBookmark,
|
||||
@@ -81,7 +81,7 @@ pub enum FormMsg {
|
||||
SaveBookmark,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum UiMsg {
|
||||
AddressBlurDown,
|
||||
AddressBlurUp,
|
||||
|
||||
@@ -208,7 +208,7 @@ impl FileTransferActivity {
|
||||
Ok(h) => {
|
||||
let hostname: String = h.as_os_str().to_string_lossy().to_string();
|
||||
let tokens: Vec<&str> = hostname.split('.').collect();
|
||||
String::from(*tokens.get(0).unwrap_or(&"localhost"))
|
||||
String::from(*tokens.first().unwrap_or(&"localhost"))
|
||||
}
|
||||
Err(_) => String::from("localhost"),
|
||||
};
|
||||
|
||||
@@ -102,7 +102,7 @@ impl FileTransferActivity {
|
||||
self.action_submit_local(entry);
|
||||
// Update file list if sync
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_remote_filelist();
|
||||
self.update_remote_filelist();
|
||||
}
|
||||
self.update_local_filelist();
|
||||
}
|
||||
@@ -112,7 +112,7 @@ impl FileTransferActivity {
|
||||
self.action_submit_remote(entry);
|
||||
// Update file list if sync
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_local_filelist();
|
||||
self.update_local_filelist();
|
||||
}
|
||||
self.update_remote_filelist();
|
||||
}
|
||||
@@ -161,7 +161,7 @@ impl FileTransferActivity {
|
||||
FileExplorerTab::Local => {
|
||||
self.action_go_to_local_upper_dir();
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_remote_filelist();
|
||||
self.update_remote_filelist();
|
||||
}
|
||||
// Reload file list component
|
||||
self.update_local_filelist()
|
||||
@@ -169,7 +169,7 @@ impl FileTransferActivity {
|
||||
FileExplorerTab::Remote => {
|
||||
self.action_go_to_remote_upper_dir();
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_local_filelist();
|
||||
self.update_local_filelist();
|
||||
}
|
||||
// Reload file list component
|
||||
self.update_remote_filelist()
|
||||
@@ -182,7 +182,7 @@ impl FileTransferActivity {
|
||||
FileExplorerTab::Local => {
|
||||
self.action_go_to_previous_local_dir();
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_remote_filelist();
|
||||
self.update_remote_filelist();
|
||||
}
|
||||
// Reload file list component
|
||||
self.update_local_filelist()
|
||||
@@ -190,7 +190,7 @@ impl FileTransferActivity {
|
||||
FileExplorerTab::Remote => {
|
||||
self.action_go_to_previous_remote_dir();
|
||||
if self.browser.sync_browsing && self.browser.found().is_none() {
|
||||
let _ = self.update_local_filelist();
|
||||
self.update_local_filelist();
|
||||
}
|
||||
// Reload file list component
|
||||
self.update_remote_filelist()
|
||||
|
||||
@@ -80,8 +80,8 @@ impl FileTransferActivity {
|
||||
self.refresh_local_status_bar();
|
||||
self.refresh_remote_status_bar();
|
||||
// Update components
|
||||
let _ = self.update_local_filelist();
|
||||
let _ = self.update_remote_filelist();
|
||||
self.update_local_filelist();
|
||||
self.update_remote_filelist();
|
||||
// Global listener
|
||||
self.mount_global_listener();
|
||||
// Give focus to local explorer
|
||||
|
||||
@@ -278,7 +278,7 @@ impl NotificationsThreshold {
|
||||
parse_bytesize(bytes).is_some()
|
||||
}
|
||||
fn char_valid(_input: &str, incoming: char) -> bool {
|
||||
incoming.is_digit(10) || ['B', 'K', 'M', 'G', 'T', 'P'].contains(&incoming)
|
||||
incoming.is_ascii_digit() || ['B', 'K', 'M', 'G', 'T', 'P'].contains(&incoming)
|
||||
}
|
||||
Self {
|
||||
component: Input::default()
|
||||
|
||||
@@ -99,7 +99,7 @@ pub enum IdTheme {
|
||||
TransferTitle2,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Msg {
|
||||
Common(CommonMsg),
|
||||
Config(ConfigMsg),
|
||||
@@ -108,7 +108,7 @@ pub enum Msg {
|
||||
None,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum CommonMsg {
|
||||
ChangeLayout,
|
||||
CloseErrorPopup,
|
||||
@@ -125,7 +125,7 @@ pub enum CommonMsg {
|
||||
WindowResized,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum ConfigMsg {
|
||||
CheckUpdatesBlurDown,
|
||||
CheckUpdatesBlurUp,
|
||||
@@ -152,7 +152,7 @@ pub enum ConfigMsg {
|
||||
TextEditorBlurUp,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum SshMsg {
|
||||
CloseDelSshKeyPopup,
|
||||
CloseNewSshKeyPopup,
|
||||
@@ -165,7 +165,7 @@ pub enum SshMsg {
|
||||
SshUsernameBlur,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum ThemeMsg {
|
||||
AuthAddressBlurDown,
|
||||
AuthAddressBlurUp,
|
||||
@@ -230,7 +230,7 @@ const STORE_CONFIG_CHANGED: &str = "SETUP_CONFIG_CHANGED";
|
||||
/// ### ViewLayout
|
||||
///
|
||||
/// Current view layout
|
||||
#[derive(PartialEq)]
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub enum ViewLayout {
|
||||
SetupForm,
|
||||
SshKeys,
|
||||
|
||||
Reference in New Issue
Block a user