Skip to content

Commit 6afc854

Browse files
committed
fix: resolve clippy warnings (collapsible_if, unused doc comments, next_back)
1 parent 8f19721 commit 6afc854

3 files changed

Lines changed: 20 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to Cortex are documented here.
44

5-
## [1.0.3] - 2026-06-01
5+
## [1.0.3] - 2026-05-25
66

77
### Added
88
- `cortex update` self-update command: downloads latest release from GitHub, verifies SHA-256 checksum, replaces binary (with Windows rename-then-replace pattern), and triggers reindex

src/cli/commands/reindex.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ pub fn run_reindex(repo_root: &Path, data_dir: &Path) {
2020
// Delete existing database files (graph.db, graph.db-wal, graph.db-shm)
2121
for suffix in &["", "-wal", "-shm"] {
2222
let db_file = data_dir.join(format!("graph.db{}", suffix));
23-
if db_file.exists() {
24-
if let Err(e) = fs::remove_file(&db_file) {
25-
eprintln!(
26-
"error: cannot delete '{}': {}. Close any running cortex processes.",
27-
db_file.display(),
28-
e
29-
);
30-
process::exit(1);
31-
}
23+
if db_file.exists() && let Err(e) = fs::remove_file(&db_file) {
24+
eprintln!(
25+
"error: cannot delete '{}': {}. Close any running cortex processes.",
26+
db_file.display(),
27+
e
28+
);
29+
process::exit(1);
3230
}
3331
}
3432

src/indexer/pipeline.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,7 @@ def get_aws_config():
16201620

16211621
// The excluded file should NOT appear in results
16221622
for path in &results {
1623-
let filename = path.split('/').last().unwrap_or("");
1623+
let filename = path.split('/').next_back().unwrap_or("");
16241624
prop_assert!(
16251625
!EXCLUDED_FILES.contains(&filename),
16261626
"Excluded file '{}' should not appear in walk results, but found path '{}'",
@@ -1671,13 +1671,12 @@ def get_aws_config():
16711671
"[a-z][a-z0-9_]{0,11}"
16721672
}
16731673

1674-
/// **Validates: Requirements 1.5, 2.1, 2.2**
1675-
///
1676-
/// Property 1: Gitignore-style pattern matching
1677-
///
1678-
/// Patterns loaded from .cortexignore should correctly match paths using
1679-
/// gitignore syntax: directory patterns (`dir/`), wildcard extension patterns
1680-
/// (`*.ext`), path prefix patterns (containing `/`), and simple name patterns.
1674+
// Property 1: Gitignore-style pattern matching
1675+
// Validates: Requirements 1.5, 2.1, 2.2
1676+
//
1677+
// Patterns loaded from .cortexignore should correctly match paths using
1678+
// gitignore syntax: directory patterns (`dir/`), wildcard extension patterns
1679+
// (`*.ext`), path prefix patterns (containing `/`), and simple name patterns.
16811680
proptest! {
16821681
/// Directory patterns ending in `/` match paths starting with the prefix.
16831682
#[test]
@@ -1824,12 +1823,11 @@ def get_aws_config():
18241823
// Property 2: Pattern file parsing filters non-pattern lines
18251824
// -----------------------------------------------------------------------
18261825

1827-
/// **Validates: Requirements 2.3, 2.4**
1828-
///
1829-
/// Property 2: Pattern file parsing filters non-pattern lines
1830-
///
1831-
/// Comments (lines starting with #) and empty/whitespace lines should be
1832-
/// filtered out during parsing. Only valid pattern lines remain.
1826+
// Property 2: Pattern file parsing filters non-pattern lines
1827+
// Validates: Requirements 2.3, 2.4
1828+
//
1829+
// Comments (lines starting with #) and empty/whitespace lines should be
1830+
// filtered out during parsing. Only valid pattern lines remain.
18331831
proptest! {
18341832
/// Mixed content: valid patterns, comments, and blanks. Only valid patterns
18351833
/// should appear in the result.

0 commit comments

Comments
 (0)