mirror of
https://github.com/veeso/termscp.git
synced 2025-12-06 17:15:35 -08:00
lint
This commit is contained in:
@@ -400,7 +400,7 @@ impl RadioS3NewPathStyle {
|
||||
.foreground(color)
|
||||
.rewind(true)
|
||||
.title("New path style", Alignment::Left)
|
||||
.value(if new_path_style { 0 } else { 1 }),
|
||||
.value(usize::from(!new_path_style)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,15 +22,11 @@ impl AuthActivity {
|
||||
// Headers
|
||||
assert!(self
|
||||
.app
|
||||
.mount(Id::Title, Box::new(components::Title::default()), vec![])
|
||||
.mount(Id::Title, Box::<components::Title>::default(), vec![])
|
||||
.is_ok());
|
||||
assert!(self
|
||||
.app
|
||||
.mount(
|
||||
Id::Subtitle,
|
||||
Box::new(components::Subtitle::default()),
|
||||
vec![]
|
||||
)
|
||||
.mount(Id::Subtitle, Box::<components::Subtitle>::default(), vec![])
|
||||
.is_ok());
|
||||
// Footer
|
||||
assert!(self
|
||||
@@ -975,7 +971,7 @@ impl AuthActivity {
|
||||
.app
|
||||
.mount(
|
||||
Id::GlobalListener,
|
||||
Box::new(components::GlobalListener::default()),
|
||||
Box::<components::GlobalListener>::default(),
|
||||
vec![
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
|
||||
@@ -924,7 +924,7 @@ impl FileTransferActivity {
|
||||
.app
|
||||
.mount(
|
||||
Id::GlobalListener,
|
||||
Box::new(components::GlobalListener::default()),
|
||||
Box::<components::GlobalListener>::default(),
|
||||
vec![
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
|
||||
@@ -33,7 +33,7 @@ impl CheckUpdates {
|
||||
.foreground(Color::LightYellow)
|
||||
.rewind(true)
|
||||
.title("Check for updates?", Alignment::Left)
|
||||
.value(if enabled { 0 } else { 1 }),
|
||||
.value(usize::from(!enabled)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ impl HiddenFiles {
|
||||
.foreground(Color::LightRed)
|
||||
.rewind(true)
|
||||
.title("Show hidden files? (by default)", Alignment::Left)
|
||||
.value(if enabled { 0 } else { 1 }),
|
||||
.value(usize::from(!enabled)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ impl NotificationsEnabled {
|
||||
.foreground(Color::LightRed)
|
||||
.rewind(true)
|
||||
.title("Enable notifications?", Alignment::Left)
|
||||
.value(if enabled { 0 } else { 1 }),
|
||||
.value(usize::from(!enabled)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ impl PromptOnFileReplace {
|
||||
.foreground(Color::LightBlue)
|
||||
.rewind(true)
|
||||
.title("Prompt when replacing existing files?", Alignment::Left)
|
||||
.value(if enabled { 0 } else { 1 }),
|
||||
.value(usize::from(!enabled)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Common(IdCommon::QuitPopup),
|
||||
Box::new(components::QuitPopup::default()),
|
||||
Box::<components::QuitPopup>::default(),
|
||||
vec![],
|
||||
)
|
||||
.is_ok());
|
||||
@@ -85,7 +85,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Common(IdCommon::SavePopup),
|
||||
Box::new(components::SavePopup::default()),
|
||||
Box::<components::SavePopup>::default(),
|
||||
vec![],
|
||||
)
|
||||
.is_ok());
|
||||
@@ -103,7 +103,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Common(IdCommon::Keybindings),
|
||||
Box::new(components::Keybindings::default()),
|
||||
Box::<components::Keybindings>::default(),
|
||||
vec![],
|
||||
)
|
||||
.is_ok());
|
||||
@@ -162,7 +162,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Common(IdCommon::Footer),
|
||||
Box::new(components::Footer::default()),
|
||||
Box::<components::Footer>::default(),
|
||||
vec![],
|
||||
)
|
||||
.is_ok());
|
||||
@@ -174,7 +174,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.mount(
|
||||
Id::Common(IdCommon::GlobalListener),
|
||||
Box::new(components::GlobalListener::default()),
|
||||
Box::<components::GlobalListener>::default(),
|
||||
vec![
|
||||
Sub::new(
|
||||
SubEventClause::Keyboard(KeyEvent {
|
||||
|
||||
@@ -78,7 +78,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Ssh(IdSsh::DelSshKeyPopup),
|
||||
Box::new(components::DelSshKeyPopup::default()),
|
||||
Box::<components::DelSshKeyPopup>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
@@ -96,7 +96,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Ssh(IdSsh::SshHost),
|
||||
Box::new(components::SshHost::default()),
|
||||
Box::<components::SshHost>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
@@ -104,7 +104,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Ssh(IdSsh::SshUsername),
|
||||
Box::new(components::SshUsername::default()),
|
||||
Box::<components::SshUsername>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
|
||||
@@ -246,7 +246,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Theme(IdTheme::AuthTitle),
|
||||
Box::new(components::AuthTitle::default()),
|
||||
Box::<components::AuthTitle>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
@@ -254,7 +254,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Theme(IdTheme::MiscTitle),
|
||||
Box::new(components::MiscTitle::default()),
|
||||
Box::<components::MiscTitle>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
@@ -262,7 +262,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Theme(IdTheme::TransferTitle),
|
||||
Box::new(components::TransferTitle::default()),
|
||||
Box::<components::TransferTitle>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
@@ -270,7 +270,7 @@ impl SetupActivity {
|
||||
.app
|
||||
.remount(
|
||||
Id::Theme(IdTheme::TransferTitle2),
|
||||
Box::new(components::TransferTitle2::default()),
|
||||
Box::<components::TransferTitle2>::default(),
|
||||
vec![]
|
||||
)
|
||||
.is_ok());
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn fmt_path_elide(p: &Path, width: usize) -> String {
|
||||
/// This function allows to specify an extra length to consider to elide path
|
||||
pub fn fmt_path_elide_ex(p: &Path, width: usize, extra_len: usize) -> String {
|
||||
let fmt_path: String = format!("{}", p.display());
|
||||
match fmt_path.width() + extra_len > width as usize {
|
||||
match fmt_path.width() + extra_len > width {
|
||||
false => fmt_path,
|
||||
true => {
|
||||
// Elide
|
||||
|
||||
Reference in New Issue
Block a user