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