Skip to content

Commit 5f03a40

Browse files
committed
chore: update toolchain
1 parent d904b15 commit 5f03a40

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.88.0"
2+
channel = "1.89.0"
33
components = ["rustfmt", "clippy"]

src/fs_service.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,10 @@ impl FileSystemService {
792792
*current_count += 1;
793793

794794
// Check if we've exceeded max_files (if set)
795-
if let Some(max) = max_files {
796-
if *current_count > max {
797-
continue; // Skip this entry but continue processing others
798-
}
795+
if let Some(max) = max_files
796+
&& *current_count > max
797+
{
798+
continue; // Skip this entry but continue processing others
799799
}
800800

801801
let mut json_entry = json!({
@@ -1463,10 +1463,8 @@ impl FileSystemService {
14631463
.filter_map(|e| e.ok())
14641464
.all(|e| !e.file_type().is_file() || is_system_metadata_file(e.file_name())); // Directory is empty if no files are found in it or subdirs, ".DS_Store" will be ignores on Mac
14651465

1466-
if is_empty {
1467-
if let Some(path_str) = entry.path().to_str() {
1468-
empty_dirs.push(path_str.to_string());
1469-
}
1466+
if is_empty && let Some(path_str) = entry.path().to_str() {
1467+
empty_dirs.push(path_str.to_string());
14701468
}
14711469
}
14721470

@@ -1505,13 +1503,13 @@ impl FileSystemService {
15051503
.filter(|e| e.file_type().is_file()); // Only files
15061504

15071505
for entry in entries {
1508-
if let Ok(metadata) = entry.metadata() {
1509-
if let Some(path_str) = entry.path().to_str() {
1510-
size_map
1511-
.entry(metadata.len())
1512-
.or_default()
1513-
.push(path_str.to_string());
1514-
}
1506+
if let Ok(metadata) = entry.metadata()
1507+
&& let Some(path_str) = entry.path().to_str()
1508+
{
1509+
size_map
1510+
.entry(metadata.len())
1511+
.or_default()
1512+
.push(path_str.to_string());
15151513
}
15161514
}
15171515

src/fs_service/utils.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ pub fn normalize_path(path: &Path) -> PathBuf {
6666
}
6767

6868
pub fn expand_home(path: PathBuf) -> PathBuf {
69-
if let Some(home_dir) = home_dir() {
70-
if path.starts_with("~") {
71-
let stripped_path = path.strip_prefix("~").unwrap_or(&path);
72-
return home_dir.join(stripped_path);
73-
}
69+
if let Some(home_dir) = home_dir()
70+
&& path.starts_with("~")
71+
{
72+
let stripped_path = path.strip_prefix("~").unwrap_or(&path);
73+
return home_dir.join(stripped_path);
7474
}
7575
path
7676
}

tests/test_tools.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,16 @@ async fn ensure_tools_duplication() {
147147
duplicate_names.push(t.name.to_string());
148148
}
149149

150-
if let Some(title) = t.title {
151-
if !titles.insert(title.to_string()) {
152-
duplicate_titles.push(title.to_string());
153-
}
150+
if let Some(title) = t.title
151+
&& !titles.insert(title.to_string())
152+
{
153+
duplicate_titles.push(title.to_string());
154154
}
155155

156-
if let Some(description) = t.description {
157-
if !descriptions.insert(description.to_string()) {
158-
duplicate_descriptions.push(description.to_string());
159-
}
156+
if let Some(description) = t.description
157+
&& !descriptions.insert(description.to_string())
158+
{
159+
duplicate_descriptions.push(description.to_string());
160160
}
161161
}
162162

0 commit comments

Comments
 (0)