Skip to content

Commit f7bdda9

Browse files
committed
fix: resolve remaining clippy lints for Rust 1.94 CI
- .filter(..).next_back() → .rfind(..) in compression_ops - Remove needless borrows in file_associations_ops and system_ops - Vec::new()+push → vec![] macro - if let Ok(_) → .is_ok() - Add .orchestrate/ to .gitignore
1 parent 9c25a20 commit f7bdda9

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ e2e/screenshots/
4040
*.bak
4141
*.swp
4242

43-
CLAUDE.md
43+
CLAUDE.md.orchestrate/

apps/src-tauri/src/operations/compression_ops.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,7 @@ async fn get_zip_info(archive_path: &Path) -> Result<ArchiveInfo, String> {
11161116
let entry_name = file
11171117
.name()
11181118
.split('/')
1119-
.filter(|s| !s.is_empty())
1120-
.next_back()
1119+
.rfind(|s| !s.is_empty())
11211120
.unwrap_or("")
11221121
.to_string();
11231122
files.push(ArchiveEntry {
@@ -1242,8 +1241,7 @@ fn get_tar_info_from_reader<R: Read>(
12421241

12431242
let entry_name = path
12441243
.split('/')
1245-
.filter(|s| !s.is_empty())
1246-
.next_back()
1244+
.rfind(|s| !s.is_empty())
12471245
.unwrap_or("")
12481246
.to_string();
12491247
files.push(ArchiveEntry {
@@ -1691,8 +1689,7 @@ async fn get_7z_info(archive_path: &Path) -> Result<ArchiveInfo, String> {
16911689

16921690
let entry_name = name_str
16931691
.split('/')
1694-
.filter(|s| !s.is_empty())
1695-
.next_back()
1692+
.rfind(|s| !s.is_empty())
16961693
.unwrap_or("")
16971694
.to_string();
16981695

@@ -1958,8 +1955,7 @@ async fn get_rar_info(archive_path: &Path) -> Result<ArchiveInfo, String> {
19581955
let entry_name = full_path
19591956
.split('/')
19601957
.chain(full_path.split('\\'))
1961-
.filter(|s| !s.is_empty())
1962-
.next_back()
1958+
.rfind(|s| !s.is_empty())
19631959
.unwrap_or("")
19641960
.to_string();
19651961

apps/src-tauri/src/operations/file_associations_ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub async fn open_file_with_application(file_path: String, app_path: String) ->
6464

6565
#[cfg(windows)]
6666
{
67-
let output = Command::new(&app_path).arg(&file_path).spawn();
67+
let output = Command::new(app_path).arg(file_path).spawn();
6868

6969
match output {
7070
Ok(_) => Ok(()),
@@ -74,7 +74,7 @@ pub async fn open_file_with_application(file_path: String, app_path: String) ->
7474

7575
#[cfg(all(unix, not(target_os = "macos")))]
7676
{
77-
let output = Command::new(&app_path).arg(&file_path).spawn();
77+
let output = Command::new(app_path).arg(file_path).spawn();
7878

7979
match output {
8080
Ok(_) => Ok(()),

apps/src-tauri/src/operations/system_ops.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,13 @@ pub async fn list_drives() -> Result<Vec<DriveInfo>, String> {
8888

8989
#[cfg(target_os = "linux")]
9090
{
91-
let mut drives = Vec::new();
92-
drives.push(DriveInfo {
91+
let drives = vec![DriveInfo {
9392
letter: String::new(),
9493
label: "Root".to_string(),
9594
path: "/".to_string(),
9695
total_space: 0,
9796
free_space: 0,
98-
});
97+
}];
9998
Ok(drives)
10099
}
101100
}
@@ -462,7 +461,7 @@ pub async fn open_file(path: String) -> Result<(), String> {
462461
#[cfg(target_os = "linux")]
463462
{
464463
std::process::Command::new("xdg-open")
465-
.arg(&path)
464+
.arg(path)
466465
.spawn()
467466
.map_err(|e| format!("Failed to open file: {}", e))?;
468467
}
@@ -510,10 +509,11 @@ pub async fn open_in_terminal(path: String) -> Result<(), String> {
510509
let mut success = false;
511510

512511
for terminal in &terminals {
513-
if let Ok(_) = std::process::Command::new(terminal)
512+
if std::process::Command::new(terminal)
514513
.arg("--working-directory")
515-
.arg(&dir_path)
514+
.arg(dir_path)
516515
.spawn()
516+
.is_ok()
517517
{
518518
success = true;
519519
break;

0 commit comments

Comments
 (0)