mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
linter
This commit is contained in:
@@ -44,7 +44,7 @@ impl AuthActivity {
|
||||
// Iterate over kyes
|
||||
let name: Option<&String> = self.bookmarks_list.get(idx);
|
||||
if let Some(name) = name {
|
||||
bookmarks_cli.del_bookmark(&name);
|
||||
bookmarks_cli.del_bookmark(name);
|
||||
// Write bookmarks
|
||||
self.write_bookmarks();
|
||||
}
|
||||
@@ -60,7 +60,7 @@ impl AuthActivity {
|
||||
if let Some(bookmarks_cli) = self.bookmarks_client.as_ref() {
|
||||
// Iterate over bookmarks
|
||||
if let Some(key) = self.bookmarks_list.get(idx) {
|
||||
if let Some(bookmark) = bookmarks_cli.get_bookmark(&key) {
|
||||
if let Some(bookmark) = bookmarks_cli.get_bookmark(key) {
|
||||
// Load parameters into components
|
||||
self.load_bookmark_into_gui(
|
||||
bookmark.0, bookmark.1, bookmark.2, bookmark.3, bookmark.4,
|
||||
@@ -104,7 +104,7 @@ impl AuthActivity {
|
||||
if let Some(client) = self.bookmarks_client.as_mut() {
|
||||
let name: Option<&String> = self.recents_list.get(idx);
|
||||
if let Some(name) = name {
|
||||
client.del_recent(&name);
|
||||
client.del_recent(name);
|
||||
// Write bookmarks
|
||||
self.write_bookmarks();
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ impl FileTransferActivity {
|
||||
}
|
||||
|
||||
pub(crate) fn local_remove_file(&mut self, entry: &FsEntry) {
|
||||
match self.host.remove(&entry) {
|
||||
match self.host.remove(entry) {
|
||||
Ok(_) => {
|
||||
// Log
|
||||
self.log(
|
||||
@@ -94,7 +94,7 @@ impl FileTransferActivity {
|
||||
}
|
||||
|
||||
pub(crate) fn remote_remove_file(&mut self, entry: &FsEntry) {
|
||||
match self.client.remove(&entry) {
|
||||
match self.client.remove(entry) {
|
||||
Ok(_) => {
|
||||
self.log(
|
||||
LogLevel::Info,
|
||||
|
||||
@@ -142,7 +142,7 @@ impl Browser {
|
||||
let mut builder: FileExplorerBuilder = FileExplorerBuilder::new();
|
||||
// Set common keys
|
||||
builder
|
||||
.with_file_sorting(FileSorting::ByName)
|
||||
.with_file_sorting(FileSorting::Name)
|
||||
.with_stack_size(16)
|
||||
.with_group_dirs(cli.get_group_dirs())
|
||||
.with_hidden_files(cli.get_show_hidden_files());
|
||||
@@ -154,7 +154,7 @@ impl Browser {
|
||||
/// Build explorer reading from `ConfigClient`, for found result (has some differences)
|
||||
fn build_found_explorer() -> FileExplorer {
|
||||
FileExplorerBuilder::new()
|
||||
.with_file_sorting(FileSorting::ByName)
|
||||
.with_file_sorting(FileSorting::Name)
|
||||
.with_group_dirs(Some(GroupDirs::First))
|
||||
.with_hidden_files(true)
|
||||
.with_stack_size(0)
|
||||
|
||||
@@ -228,7 +228,7 @@ impl FileTransferActivity {
|
||||
///
|
||||
/// Returns config client reference
|
||||
fn config(&self) -> &ConfigClient {
|
||||
&self.context().config()
|
||||
self.context().config()
|
||||
}
|
||||
|
||||
/// ### theme
|
||||
|
||||
@@ -381,7 +381,7 @@ impl FileTransferActivity {
|
||||
}
|
||||
// Send entry; name is always None after first call
|
||||
self.filetransfer_send_recurse(
|
||||
&entry,
|
||||
entry,
|
||||
remote_path.as_path(),
|
||||
None,
|
||||
);
|
||||
@@ -730,7 +730,7 @@ impl FileTransferActivity {
|
||||
// Receive entry; name is always None after first call
|
||||
// Local path becomes local_dir_path
|
||||
self.filetransfer_recv_recurse(
|
||||
&entry,
|
||||
entry,
|
||||
local_dir_path.as_path(),
|
||||
None,
|
||||
);
|
||||
|
||||
@@ -663,10 +663,10 @@ impl Update for FileTransferActivity {
|
||||
(COMPONENT_RADIO_SORTING, Msg::OnChange(Payload::One(Value::Usize(mode)))) => {
|
||||
// Get sorting mode
|
||||
let sorting: FileSorting = match mode {
|
||||
1 => FileSorting::ByModifyTime,
|
||||
2 => FileSorting::ByCreationTime,
|
||||
3 => FileSorting::BySize,
|
||||
_ => FileSorting::ByName,
|
||||
1 => FileSorting::ModifyTime,
|
||||
2 => FileSorting::CreationTime,
|
||||
3 => FileSorting::Size,
|
||||
_ => FileSorting::Name,
|
||||
};
|
||||
match self.browser.tab() {
|
||||
FileExplorerTab::Local => self.local_mut().sort_by(sorting),
|
||||
|
||||
@@ -770,10 +770,10 @@ impl FileTransferActivity {
|
||||
_ => panic!("You can't mount file sorting when in found result"),
|
||||
};
|
||||
let index: usize = match sorting {
|
||||
FileSorting::ByCreationTime => 2,
|
||||
FileSorting::ByModifyTime => 1,
|
||||
FileSorting::ByName => 0,
|
||||
FileSorting::BySize => 3,
|
||||
FileSorting::CreationTime => 2,
|
||||
FileSorting::ModifyTime => 1,
|
||||
FileSorting::Name => 0,
|
||||
FileSorting::Size => 3,
|
||||
};
|
||||
self.view.mount(
|
||||
super::COMPONENT_RADIO_SORTING,
|
||||
@@ -1280,10 +1280,10 @@ impl FileTransferActivity {
|
||||
|
||||
fn get_file_sorting_str(mode: FileSorting) -> &'static str {
|
||||
match mode {
|
||||
FileSorting::ByName => "By name",
|
||||
FileSorting::ByCreationTime => "By creation time",
|
||||
FileSorting::ByModifyTime => "By modify time",
|
||||
FileSorting::BySize => "By size",
|
||||
FileSorting::Name => "By name",
|
||||
FileSorting::CreationTime => "By creation time",
|
||||
FileSorting::ModifyTime => "By modify time",
|
||||
FileSorting::Size => "By size",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ impl SetupActivity {
|
||||
}
|
||||
|
||||
fn config(&self) -> &ConfigClient {
|
||||
&self.context().config()
|
||||
self.context().config()
|
||||
}
|
||||
|
||||
fn config_mut(&mut self) -> &mut ConfigClient {
|
||||
|
||||
Reference in New Issue
Block a user