Desenvolvido por @veeso
-Versão atual: 0.17.0 24/03/2025
+Versão atual: 0.18.0 24/03/2025
由 @veeso 开发
-当前版本: 0.17.0 24/03/2025
+当前版本: 0.18.0 24/03/2025
Consider that Chocolatey moderation can take up to a few weeks
since last release, so if the latest version is not available yet,
you can install it downloading the ZIP file from
- Github
and then, from the ZIP directory, install it via
@@ -74,7 +74,7 @@
On Debian based distros, you can install termscp using the Deb
package via:
- wget -O termscp.deb https://github.com/veeso/termscp/releases/latest/download/termscp_0.17.0_amd64.deb
+ wget -O termscp.deb https://github.com/veeso/termscp/releases/latest/download/termscp_0.18.0_amd64.deb
sudo dpkg -i termscp.deb
diff --git a/site/html/home.html b/site/html/home.html
index dc4c973..90ec757 100644
--- a/site/html/home.html
+++ b/site/html/home.html
@@ -12,7 +12,7 @@
- termscp 0.17.0 is NOW out! Download it from
+ termscp 0.18.0 is NOW out! Download it from
here!
diff --git a/site/lang/en.json b/site/lang/en.json
index f682492..d02566f 100644
--- a/site/lang/en.json
+++ b/site/lang/en.json
@@ -12,7 +12,7 @@
"intro": {
"caption": "A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/Kube/S3/WebDAV",
"getStarted": "Get started →",
- "versionAlert": "termscp 0.17.0 is NOW out! Download it from",
+ "versionAlert": "termscp 0.18.0 is NOW out! Download it from",
"here": "here",
"features": {
"handy": {
diff --git a/site/lang/es.json b/site/lang/es.json
index 15542f3..48154b3 100644
--- a/site/lang/es.json
+++ b/site/lang/es.json
@@ -12,7 +12,7 @@
"intro": {
"caption": "Un explorador y transferencia de archivos de terminal rico en funciones, con apoyo para SCP/SFTP/FTP/Kube/S3/WebDAV",
"getStarted": "Para iniciar →",
- "versionAlert": "termscp 0.17.0 ya está disponible! Descárgalo desde",
+ "versionAlert": "termscp 0.18.0 ya está disponible! Descárgalo desde",
"here": "aquì",
"features": {
"handy": {
diff --git a/site/lang/fr.json b/site/lang/fr.json
index a6d2685..a6a9462 100644
--- a/site/lang/fr.json
+++ b/site/lang/fr.json
@@ -12,7 +12,7 @@
"intro": {
"caption": "Un file transfer et navigateur de terminal riche en fonctionnalités avec support pour SCP/SFTP/FTP/Kube/S3/WebDAV",
"getStarted": "Pour commencer →",
- "versionAlert": "termscp 0.17.0 est maintenant sorti! Télécharge-le depuis",
+ "versionAlert": "termscp 0.18.0 est maintenant sorti! Télécharge-le depuis",
"here": "ici",
"features": {
"handy": {
diff --git a/site/lang/it.json b/site/lang/it.json
index 5f3870f..f444677 100644
--- a/site/lang/it.json
+++ b/site/lang/it.json
@@ -12,7 +12,7 @@
"intro": {
"caption": "Un file transfer ed explorer ricco di funzionalità con supporto per SFTP/SCP/FTP/S3",
"getStarted": "Installa termscp →",
- "versionAlert": "termscp 0.17.0 è ORA disponbile! Scaricalo da",
+ "versionAlert": "termscp 0.18.0 è ORA disponbile! Scaricalo da",
"here": "qui",
"features": {
"handy": {
diff --git a/site/lang/zh-CN.json b/site/lang/zh-CN.json
index 7dda34e..15efff5 100644
--- a/site/lang/zh-CN.json
+++ b/site/lang/zh-CN.json
@@ -12,7 +12,7 @@
"intro": {
"caption": "功能丰富的终端 UI 文件传输和浏览器,支持 SCP/SFTP/FTP/Kube/S3/WebDAV",
"getStarted": "开始 →",
- "versionAlert": "termscp 0.17.0 现已发布! 从下载",
+ "versionAlert": "termscp 0.18.0 现已发布! 从下载",
"here": "这里",
"features": {
"handy": {
diff --git a/src/explorer/formatter.rs b/src/explorer/formatter.rs
index 113d00c..b900095 100644
--- a/src/explorer/formatter.rs
+++ b/src/explorer/formatter.rs
@@ -504,10 +504,7 @@ impl Formatter {
};
// Match format length: group 3
let fmt_len: Option = match ®ex_match.get(3) {
- Some(len) => match len.as_str().parse::() {
- Ok(len) => Some(len),
- Err(_) => None,
- },
+ Some(len) => len.as_str().parse::().ok(),
None => None,
};
// Match format extra: group 2 + 1
diff --git a/src/support.rs b/src/support.rs
index e6cd1b8..64a0561 100644
--- a/src/support.rs
+++ b/src/support.rs
@@ -79,10 +79,7 @@ fn get_config_client() -> Option {
Err(_) => None,
Ok(dir) => {
let (cfg_path, ssh_key_dir) = environment::get_config_paths(dir.as_path());
- match ConfigClient::new(cfg_path.as_path(), ssh_key_dir.as_path()) {
- Err(_) => None,
- Ok(c) => Some(c),
- }
+ ConfigClient::new(cfg_path.as_path(), ssh_key_dir.as_path()).ok()
}
}
}
diff --git a/src/system/config_client.rs b/src/system/config_client.rs
index 977a144..e7b9aa1 100644
--- a/src/system/config_client.rs
+++ b/src/system/config_client.rs
@@ -153,10 +153,7 @@ impl ConfigClient {
// Convert string to `GroupDirs`
match &self.config.user_interface.group_dirs {
None => None,
- Some(val) => match GroupDirs::from_str(val.as_str()) {
- Ok(val) => Some(val),
- Err(_) => None,
- },
+ Some(val) => GroupDirs::from_str(val.as_str()).ok(),
}
}
diff --git a/src/system/sshkey_storage.rs b/src/system/sshkey_storage.rs
index 2424f31..090c229 100644
--- a/src/system/sshkey_storage.rs
+++ b/src/system/sshkey_storage.rs
@@ -44,13 +44,10 @@ impl SshKeyStorage {
/// Resolve host via ssh2 configuration
fn resolve_host_in_ssh2_configuration(&self, host: &str) -> Option {
self.ssh_config.as_ref().and_then(|x| {
- let key = x
- .query(host)
+ x.query(host)
.identity_file
.as_ref()
- .and_then(|x| x.first().cloned());
-
- key
+ .and_then(|x| x.first().cloned())
})
}
}
diff --git a/src/ui/activities/auth/components/bookmarks.rs b/src/ui/activities/auth/components/bookmarks.rs
index 178e377..31f70cb 100644
--- a/src/ui/activities/auth/components/bookmarks.rs
+++ b/src/ui/activities/auth/components/bookmarks.rs
@@ -197,7 +197,7 @@ impl DeleteBookmarkPopup {
.color(color)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.value(1)
.rewind(true)
.foreground(color)
@@ -265,7 +265,7 @@ impl DeleteRecentPopup {
.color(color)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.value(1)
.rewind(true)
.foreground(color)
@@ -337,7 +337,7 @@ impl BookmarkSavePassword {
.sides(BorderSides::BOTTOM | BorderSides::LEFT | BorderSides::RIGHT)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.value(0)
.rewind(true)
.foreground(color)
diff --git a/src/ui/activities/auth/components/form.rs b/src/ui/activities/auth/components/form.rs
index e2bed3a..8e15428 100644
--- a/src/ui/activities/auth/components/form.rs
+++ b/src/ui/activities/auth/components/form.rs
@@ -36,9 +36,9 @@ impl RemoteProtocolRadio {
.modifiers(BorderType::Rounded),
)
.choices(if cfg!(smb) {
- &["SFTP", "SCP", "FTP", "FTPS", "S3", "Kube", "WebDAV", "SMB"]
+ vec!["SFTP", "SCP", "FTP", "FTPS", "S3", "Kube", "WebDAV", "SMB"].into_iter()
} else {
- &["SFTP", "SCP", "FTP", "FTPS", "S3", "Kube", "WebDAV"]
+ vec!["SFTP", "SCP", "FTP", "FTPS", "S3", "Kube", "WebDAV"].into_iter()
})
.foreground(color)
.rewind(true)
@@ -126,7 +126,7 @@ impl HostBridgeProtocolRadio {
.modifiers(BorderType::Rounded),
)
.choices(if cfg!(smb) {
- &[
+ vec![
"Localhost",
"SFTP",
"SCP",
@@ -137,8 +137,9 @@ impl HostBridgeProtocolRadio {
"WebDAV",
"SMB",
]
+ .into_iter()
} else {
- &[
+ vec![
"Localhost",
"SFTP",
"SCP",
@@ -148,6 +149,7 @@ impl HostBridgeProtocolRadio {
"Kube",
"WebDAV",
]
+ .into_iter()
})
.foreground(color)
.rewind(true)
@@ -649,7 +651,7 @@ impl RadioS3NewPathStyle {
.color(color)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(color)
.rewind(true)
.title("New path style", Alignment::Left)
diff --git a/src/ui/activities/auth/components/popup.rs b/src/ui/activities/auth/components/popup.rs
index 340c0d2..43b1b2d 100644
--- a/src/ui/activities/auth/components/popup.rs
+++ b/src/ui/activities/auth/components/popup.rs
@@ -28,7 +28,7 @@ impl ErrorPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -64,7 +64,7 @@ impl InfoPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -100,7 +100,7 @@ impl WaitPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -130,7 +130,7 @@ impl WindowSizeError {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(
+ .text([TextSpan::from(
"termscp requires at least 24 lines of height to run",
)])
.wrap(true),
@@ -163,7 +163,7 @@ impl QuitPopup {
.foreground(color)
.title("Quit termscp?", Alignment::Center)
.rewind(true)
- .choices(&["Yes", "No"]),
+ .choices(["Yes", "No"]),
}
}
}
@@ -230,7 +230,7 @@ impl InstallUpdatePopup {
.foreground(color)
.title("Install update?", Alignment::Center)
.rewind(true)
- .choices(&["Yes", "No"]),
+ .choices(["Yes", "No"]),
}
}
}
@@ -296,13 +296,7 @@ impl ReleaseNotes {
)
.foreground(color)
.title("Release notes", Alignment::Center)
- .text_rows(
- notes
- .lines()
- .map(TextSpan::from)
- .collect::>()
- .as_slice(),
- ),
+ .text_rows(notes.lines().map(TextSpan::from)),
}
}
}
diff --git a/src/ui/activities/auth/components/text.rs b/src/ui/activities/auth/components/text.rs
index c56ae59..60bf2e8 100644
--- a/src/ui/activities/auth/components/text.rs
+++ b/src/ui/activities/auth/components/text.rs
@@ -64,7 +64,7 @@ pub struct NewVersionDisclaimer {
impl NewVersionDisclaimer {
pub fn new(new_version: &str, color: Color) -> Self {
Self {
- component: Span::default().foreground(color).spans(&[
+ component: Span::default().foreground(color).spans([
TextSpan::from("termscp "),
TextSpan::new(new_version).underlined().bold(),
TextSpan::from(
@@ -91,7 +91,7 @@ pub struct HelpFooter {
impl HelpFooter {
pub fn new(key_color: Color) -> Self {
Self {
- component: Span::default().spans(&[
+ component: Span::default().spans([
TextSpan::from("").bold().fg(key_color),
TextSpan::from(" Help "),
TextSpan::from("").bold().fg(key_color),
diff --git a/src/ui/activities/filetransfer/components/log.rs b/src/ui/activities/filetransfer/components/log.rs
index 2b2ee27..1930acc 100644
--- a/src/ui/activities/filetransfer/components/log.rs
+++ b/src/ui/activities/filetransfer/components/log.rs
@@ -53,12 +53,20 @@ impl MockComponent for Log {
.unwrap()
.unwrap_table()
.iter()
- .map(|row| ListItem::new(tui_realm_stdlib::utils::wrap_spans(row, width, &self.props)))
+ .map(|row| {
+ let row_refs = row.iter().collect::>();
+ ListItem::new(tui_realm_stdlib::utils::wrap_spans(
+ row_refs.as_slice(),
+ width,
+ &self.props,
+ ))
+ })
.collect();
+ let title = ("Log".to_string(), Alignment::Left);
let w = TuiList::new(list_items)
.block(tui_realm_stdlib::utils::get_block(
borders,
- Some(("Log".to_string(), Alignment::Left)),
+ Some(&title),
focus,
None,
))
diff --git a/src/ui/activities/filetransfer/components/misc.rs b/src/ui/activities/filetransfer/components/misc.rs
index 5ff8965..de22e13 100644
--- a/src/ui/activities/filetransfer/components/misc.rs
+++ b/src/ui/activities/filetransfer/components/misc.rs
@@ -16,7 +16,7 @@ pub struct FooterBar {
impl FooterBar {
pub fn new(key_color: Color) -> Self {
Self {
- component: Span::default().spans(&[
+ component: Span::default().spans([
TextSpan::from("").bold().fg(key_color),
TextSpan::from(" Help "),
TextSpan::from("").bold().fg(key_color),
diff --git a/src/ui/activities/filetransfer/components/popups.rs b/src/ui/activities/filetransfer/components/popups.rs
index eb4f665..17b15ce 100644
--- a/src/ui/activities/filetransfer/components/popups.rs
+++ b/src/ui/activities/filetransfer/components/popups.rs
@@ -214,7 +214,7 @@ impl DeletePopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.value(1)
.title("Delete file(s)?", Alignment::Center),
}
@@ -279,7 +279,7 @@ impl DisconnectPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.title("Are you sure you want to disconnect?", Alignment::Center),
}
}
@@ -344,7 +344,7 @@ impl ErrorPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -461,7 +461,7 @@ impl FatalPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -1121,7 +1121,7 @@ impl QuitPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.title("Are you sure you want to quit termscp?", Alignment::Center),
}
}
@@ -1275,7 +1275,7 @@ impl ReplacePopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.title(text, Alignment::Center),
}
}
@@ -1502,7 +1502,7 @@ impl SortingPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Name", "Modify time", "Creation time", "Size"])
+ .choices(["Name", "Modify time", "Creation time", "Size"])
.title("Sort files by…", Alignment::Center)
.value(match value {
FileSorting::CreationTime => 2,
@@ -1554,7 +1554,7 @@ impl StatusBarLocal {
let file_sorting = file_sorting_label(browser.host_bridge().file_sorting);
let hidden_files = hidden_files_label(browser.host_bridge().hidden_files_visible());
Self {
- component: Span::default().spans(&[
+ component: Span::default().spans([
TextSpan::new("File sorting: ").fg(sorting_color),
TextSpan::new(file_sorting).fg(sorting_color).reversed(),
TextSpan::new(" Hidden files: ").fg(hidden_color),
@@ -1589,7 +1589,7 @@ impl StatusBarRemote {
false => "OFF",
};
Self {
- component: Span::default().spans(&[
+ component: Span::default().spans([
TextSpan::new("File sorting: ").fg(sorting_color),
TextSpan::new(file_sorting).fg(sorting_color).reversed(),
TextSpan::new(" Hidden files: ").fg(hidden_color),
@@ -1728,7 +1728,7 @@ impl SyncBrowsingMkdirPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.title(
format!(
r#"Sync browsing: directory "{dir_name}" doesn't exist. Do you want to create it?"#
@@ -1802,7 +1802,7 @@ impl WaitPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -1830,7 +1830,7 @@ impl WalkdirWaitPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .text(&[
+ .text([
TextSpan::from(text.as_ref()),
TextSpan::from("Press 'CTRL+C' to abort"),
])
@@ -1961,7 +1961,7 @@ impl WatcherPopup {
.modifiers(BorderType::Rounded),
)
.foreground(color)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.title(text, Alignment::Center),
}
}
diff --git a/src/ui/activities/filetransfer/components/popups/chmod.rs b/src/ui/activities/filetransfer/components/popups/chmod.rs
index b3710a8..0c81ff4 100644
--- a/src/ui/activities/filetransfer/components/popups/chmod.rs
+++ b/src/ui/activities/filetransfer/components/popups/chmod.rs
@@ -59,21 +59,21 @@ impl ChmodPopup {
},
user: Checkbox::default()
.foreground(color)
- .choices(&["Read", "Write", "Execute"])
+ .choices(["Read", "Write", "Execute"])
.title("User", Alignment::Left)
.borders(Borders::default().sides(BorderSides::NONE))
.values(&make_pex_values(pex.user()))
.rewind(true),
group: Checkbox::default()
.foreground(color)
- .choices(&["Read", "Write", "Execute"])
+ .choices(["Read", "Write", "Execute"])
.title("Group", Alignment::Left)
.borders(Borders::default().sides(BorderSides::NONE))
.values(&make_pex_values(pex.group()))
.rewind(true),
others: Checkbox::default()
.foreground(color)
- .choices(&["Read", "Write", "Execute"])
+ .choices(["Read", "Write", "Execute"])
.title("Others", Alignment::Left)
.borders(Borders::default().sides(BorderSides::NONE))
.values(&make_pex_values(pex.others()))
@@ -208,9 +208,11 @@ impl MockComponent for ChmodPopup {
.get_or(Attribute::Focus, AttrValue::Flag(false))
.unwrap_flag();
+ let div_title = (self.title.clone(), Alignment::Center);
+
let div = tui_realm_stdlib::utils::get_block(
Borders::default().color(self.color),
- Some((self.title.clone(), Alignment::Center)),
+ Some(&div_title),
focus,
None,
);
diff --git a/src/ui/activities/filetransfer/components/transfer/file_list.rs b/src/ui/activities/filetransfer/components/transfer/file_list.rs
index b5a65ce..3a97a06 100644
--- a/src/ui/activities/filetransfer/components/transfer/file_list.rs
+++ b/src/ui/activities/filetransfer/components/transfer/file_list.rs
@@ -158,7 +158,7 @@ impl MockComponent for FileList {
.props
.get_or(Attribute::Focus, AttrValue::Flag(false))
.unwrap_flag();
- let div = tui_realm_stdlib::utils::get_block(borders, Some(title), focus, None);
+ let div = tui_realm_stdlib::utils::get_block(borders, Some(&title), focus, None);
// Make list entries
let init_table_iter = if self.has_dot_dot() {
vec![vec![TextSpan::from("..")]]
diff --git a/src/ui/activities/filetransfer/components/transfer/file_list_with_search.rs b/src/ui/activities/filetransfer/components/transfer/file_list_with_search.rs
index fd0b0cb..326528d 100644
--- a/src/ui/activities/filetransfer/components/transfer/file_list_with_search.rs
+++ b/src/ui/activities/filetransfer/components/transfer/file_list_with_search.rs
@@ -57,7 +57,7 @@ impl FileListWithSearch {
pub fn borders(mut self, b: Borders) -> Self {
self.file_list
- .attr(Attribute::Borders, AttrValue::Borders(b.clone()));
+ .attr(Attribute::Borders, AttrValue::Borders(b));
self.search.attr(Attribute::Borders, AttrValue::Borders(b));
self
}
diff --git a/src/ui/activities/filetransfer/components/transfer/mod.rs b/src/ui/activities/filetransfer/components/transfer/mod.rs
index 6b62ad4..027ef5f 100644
--- a/src/ui/activities/filetransfer/components/transfer/mod.rs
+++ b/src/ui/activities/filetransfer/components/transfer/mod.rs
@@ -28,7 +28,7 @@ impl ExplorerFuzzy {
.foreground(fg)
.highlighted_color(hg)
.title(title, Alignment::Left)
- .rows(files.iter().map(|x| vec![TextSpan::from(x)]).collect()),
+ .rows(files.iter().map(|x| vec![TextSpan::from(*x)]).collect()),
}
}
@@ -236,7 +236,7 @@ impl ExplorerFind {
.foreground(fg)
.highlighted_color(hg)
.title(title, Alignment::Left)
- .rows(files.iter().map(|x| vec![TextSpan::from(x)]).collect()),
+ .rows(files.iter().map(|x| vec![TextSpan::from(*x)]).collect()),
}
}
}
@@ -373,7 +373,7 @@ impl ExplorerLocal {
.foreground(fg)
.highlighted_color(hg)
.title(title, Alignment::Left)
- .rows(files.iter().map(|x| vec![TextSpan::from(x)]).collect())
+ .rows(files.iter().map(|x| vec![TextSpan::from(*x)]).collect())
.dot_dot(true),
}
}
@@ -587,7 +587,7 @@ impl ExplorerRemote {
.foreground(fg)
.highlighted_color(hg)
.title(title, Alignment::Left)
- .rows(files.iter().map(|x| vec![TextSpan::from(x)]).collect())
+ .rows(files.iter().map(|x| vec![TextSpan::from(*x)]).collect())
.dot_dot(true),
}
}
diff --git a/src/ui/activities/filetransfer/mod.rs b/src/ui/activities/filetransfer/mod.rs
index d097287..b31e765 100644
--- a/src/ui/activities/filetransfer/mod.rs
+++ b/src/ui/activities/filetransfer/mod.rs
@@ -286,10 +286,7 @@ impl FileTransferActivity {
log_records: VecDeque::with_capacity(256), // 256 events is enough I guess
walkdir: WalkdirStates::default(),
transfer: TransferStates::default(),
- cache: match TempDir::new() {
- Ok(d) => Some(d),
- Err(_) => None,
- },
+ cache: TempDir::new().ok(),
fswatcher: if enable_fs_watcher {
FsWatcher::init(Duration::from_secs(5)).ok()
} else {
diff --git a/src/ui/activities/setup/components/commons.rs b/src/ui/activities/setup/components/commons.rs
index bf5facd..e277e60 100644
--- a/src/ui/activities/setup/components/commons.rs
+++ b/src/ui/activities/setup/components/commons.rs
@@ -26,7 +26,7 @@ impl ErrorPopup {
.modifiers(BorderType::Rounded),
)
.foreground(Color::Red)
- .text(&[TextSpan::from(text.as_ref())])
+ .text([TextSpan::from(text.as_ref())])
.wrap(true),
}
}
@@ -52,7 +52,7 @@ pub struct Footer {
impl Default for Footer {
fn default() -> Self {
Self {
- component: Span::default().spans(&[
+ component: Span::default().spans([
TextSpan::new("").bold().fg(Color::Cyan),
TextSpan::new(" Help "),
TextSpan::new("").bold().fg(Color::Cyan),
@@ -88,7 +88,7 @@ impl Header {
.color(Color::Yellow)
.sides(BorderSides::BOTTOM),
)
- .choices(&["Configuration parameters", "SSH Keys", "Theme"])
+ .choices(["Configuration parameters", "SSH Keys", "Theme"])
.foreground(Color::Yellow)
.value(match layout {
ViewLayout::SetupForm => 0,
@@ -217,7 +217,7 @@ impl Default for QuitPopup {
Alignment::Center,
)
.rewind(true)
- .choices(&["Save", "Don't save", "Cancel"]),
+ .choices(["Save", "Don't save", "Cancel"]),
}
}
}
@@ -273,7 +273,7 @@ impl Default for SavePopup {
.foreground(Color::Yellow)
.title("Save changes?", Alignment::Center)
.rewind(true)
- .choices(&["Yes", "No"]),
+ .choices(["Yes", "No"]),
}
}
}
diff --git a/src/ui/activities/setup/components/config.rs b/src/ui/activities/setup/components/config.rs
index 0ca498f..56cb8c4 100644
--- a/src/ui/activities/setup/components/config.rs
+++ b/src/ui/activities/setup/components/config.rs
@@ -33,7 +33,7 @@ impl CheckUpdates {
.color(Color::LightYellow)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(Color::LightYellow)
.rewind(true)
.title("Check for updates?", Alignment::Left)
@@ -67,7 +67,7 @@ impl DefaultProtocol {
.color(Color::Cyan)
.modifiers(BorderType::Rounded),
)
- .choices(&["SFTP", "SCP", "FTP", "FTPS", "Kube", "S3", "SMB", "WebDAV"])
+ .choices(["SFTP", "SCP", "FTP", "FTPS", "Kube", "S3", "SMB", "WebDAV"])
.foreground(Color::Cyan)
.rewind(true)
.title("Default protocol", Alignment::Left)
@@ -110,7 +110,7 @@ impl GroupDirs {
.color(Color::LightMagenta)
.modifiers(BorderType::Rounded),
)
- .choices(&["Display first", "Display last", "No"])
+ .choices(["Display first", "Display last", "No"])
.foreground(Color::LightMagenta)
.rewind(true)
.title("Group directories", Alignment::Left)
@@ -148,7 +148,7 @@ impl HiddenFiles {
.color(Color::LightRed)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(Color::LightRed)
.rewind(true)
.title("Show hidden files? (by default)", Alignment::Left)
@@ -182,7 +182,7 @@ impl NotificationsEnabled {
.color(Color::LightRed)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(Color::LightRed)
.rewind(true)
.title("Enable notifications?", Alignment::Left)
@@ -216,7 +216,7 @@ impl PromptOnFileReplace {
.color(Color::LightBlue)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(Color::LightBlue)
.rewind(true)
.title("Prompt when replacing existing files?", Alignment::Left)
diff --git a/src/ui/activities/setup/components/ssh.rs b/src/ui/activities/setup/components/ssh.rs
index 7386779..b4258bd 100644
--- a/src/ui/activities/setup/components/ssh.rs
+++ b/src/ui/activities/setup/components/ssh.rs
@@ -31,7 +31,7 @@ impl Default for DelSshKeyPopup {
.color(Color::Red)
.modifiers(BorderType::Rounded),
)
- .choices(&["Yes", "No"])
+ .choices(["Yes", "No"])
.foreground(Color::Red)
.rewind(true)
.title("Delete key?", Alignment::Center)
diff --git a/src/utils/parser.rs b/src/utils/parser.rs
index a3d8c70..a56fdc3 100644
--- a/src/utils/parser.rs
+++ b/src/utils/parser.rs
@@ -100,7 +100,7 @@ static REMOTE_SMB_OPT_REGEX: Lazy =
/**
* Regex matches:
* - group 1: Version
- * E.g. termscp-0.3.2 => 0.3.2; v0.4.0 => 0.4.0
+ * E.g. termscp-0.3.2 => 0.3.2; v0.4.0 => 0.4.0
*/
static SEMVER_REGEX: Lazy = lazy_regex!(r"v?((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*))");