Skip to content

Commit f249e00

Browse files
committed
chore: format clippy fixes
1 parent f6d6302 commit f249e00

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

crates/lsp/src/checkers/pyo3_embedded.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl PyO3EmbeddedChecker {
136136
beancount_errors.push(BeancountError::new(
137137
journal_file.to_path_buf(),
138138
0,
139-
format!("Failed to process beancount error: {}", e),
139+
format!("Failed to process beancount error: {e}"),
140140
));
141141
}
142142
}
@@ -460,8 +460,7 @@ mod tests {
460460
Err(e) => {
461461
// If beancount is not properly configured, that's OK for this test
462462
eprintln!(
463-
"Beancount check failed (possibly due to environment): {}",
464-
e
463+
"Beancount check failed (possibly due to environment): {e}"
465464
);
466465
}
467466
}
@@ -501,8 +500,7 @@ mod tests {
501500
Err(e) => {
502501
// If beancount is not properly configured, that's OK for this test
503502
eprintln!(
504-
"Beancount check failed (possibly due to environment): {}",
505-
e
503+
"Beancount check failed (possibly due to environment): {e}"
506504
);
507505
}
508506
}
@@ -544,8 +542,7 @@ mod tests {
544542
Err(e) => {
545543
// If beancount is not properly configured, that's OK for this test
546544
eprintln!(
547-
"Beancount check failed (possibly due to environment): {}",
548-
e
545+
"Beancount check failed (possibly due to environment): {e}"
549546
);
550547
}
551548
}
@@ -600,7 +597,7 @@ another error on line 9
600597

601598
// Check if we have proper line numbers (not all 0 or 1)
602599
let has_proper_line_numbers = check_result.errors.iter().any(|e| e.line > 1);
603-
println!("Has proper line numbers: {}", has_proper_line_numbers);
600+
println!("Has proper line numbers: {has_proper_line_numbers}");
604601

605602
if !has_proper_line_numbers {
606603
eprintln!("WARNING: Line number fix may not be working - all errors showing line 0 or 1");
@@ -610,8 +607,7 @@ another error on line 9
610607
}
611608
Err(e) => {
612609
eprintln!(
613-
"Beancount check failed (possibly due to environment): {}",
614-
e
610+
"Beancount check failed (possibly due to environment): {e}"
615611
);
616612
}
617613
}

crates/lsp/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ fn setup_logging(log_to_file: bool, log_level_arg: Option<&String>) {
5151
Some(level_str) => parse_log_level(level_str),
5252
None => {
5353
if log_to_file {
54-
LevelFilter::DEBUG // Default level when logging to file
54+
LevelFilter::DEBUG // Default level when logging to file
5555
} else {
56-
LevelFilter::INFO // Default level when logging to stderr
56+
LevelFilter::INFO // Default level when logging to stderr
5757
}
5858
}
5959
};
@@ -101,7 +101,7 @@ fn parse_log_level(level_str: &str) -> LevelFilter {
101101
"error" => LevelFilter::ERROR,
102102
"off" => LevelFilter::OFF,
103103
_ => {
104-
eprintln!("Invalid log level '{}'. Using 'info' as default. Valid levels: trace, debug, info, warn, error, off", level_str);
104+
eprintln!("Invalid log level '{level_str}'. Using 'info' as default. Valid levels: trace, debug, info, warn, error, off");
105105
LevelFilter::INFO
106106
}
107107
}

crates/lsp/src/providers/completion.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,12 +2239,12 @@ include "accounts1.bean"
22392239
.unwrap_or_default();
22402240

22412241
let labels: Vec<&String> = items.iter().map(|item| &item.label).collect();
2242-
2242+
22432243
// Should return only the parts after "Assets:Checking:"
22442244
assert_eq!(items.len(), 2);
22452245
assert!(labels.contains(&&"Personal".to_string()));
22462246
assert!(labels.contains(&&"Business".to_string()));
2247-
2247+
22482248
// Should NOT contain full account paths
22492249
assert!(!labels.contains(&&"Assets:Checking:Personal".to_string()));
22502250
assert!(!labels.contains(&&"Assets:Checking:Business".to_string()));
@@ -2254,7 +2254,7 @@ include "accounts1.bean"
22542254
fn test_top_level_colon_completion() {
22552255
// Test completion at top level (e.g., typing "Assets:")
22562256
let fixture = r#"
2257-
%! /main.beancount
2257+
%! /main.beancount
22582258
2023-10-01 open Assets:Checking USD
22592259
2023-10-01 open Assets:Savings USD
22602260
2023-10-01 open Expenses:Food USD
@@ -2270,12 +2270,12 @@ include "accounts1.bean"
22702270
.unwrap_or_default();
22712271

22722272
let labels: Vec<&String> = items.iter().map(|item| &item.label).collect();
2273-
2273+
22742274
// Should return only the parts after "Assets:"
22752275
assert_eq!(items.len(), 2);
22762276
assert!(labels.contains(&&"Checking".to_string()));
22772277
assert!(labels.contains(&&"Savings".to_string()));
2278-
2278+
22792279
// Should NOT contain full account paths or accounts from other hierarchies
22802280
assert!(!labels.contains(&&"Assets:Checking".to_string()));
22812281
assert!(!labels.contains(&&"Food".to_string()));

0 commit comments

Comments
 (0)