Skip to content

Commit 7b658bb

Browse files
committed
style(extract): fix rustfmt and clippy CI failures
1 parent 2b87944 commit 7b658bb

3 files changed

Lines changed: 31 additions & 7 deletions

File tree

crates/codegraph-extract/src/orchestrator.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ impl Orchestrator {
5757
/// Sync only the given paths instead of walking the whole tree. Used by the
5858
/// watcher so that a burst of filesystem events costs O(changed files),
5959
/// not O(repo size).
60-
pub fn sync_paths(&self, root: &Utf8Path, db: &Db, paths: &[Utf8PathBuf]) -> Result<ExtractStats> {
60+
pub fn sync_paths(
61+
&self,
62+
root: &Utf8Path,
63+
db: &Db,
64+
paths: &[Utf8PathBuf],
65+
) -> Result<ExtractStats> {
6166
let config = ExtractConfig::load(root);
6267
let ext_map = walker::build_ext_map(&self.extractors);
6368
let opts = walker::walk_options(&self.extractors, &config, root);

crates/codegraph-extract/src/walker.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ pub fn build_ext_map(extractors: &[Arc<dyn Extractor>]) -> ExtMap {
2929
ext_map
3030
}
3131

32-
fn find_extractor<'a>(extractors: &'a [Arc<dyn Extractor>], lang: &str) -> Option<&'a Arc<dyn Extractor>> {
32+
fn find_extractor<'a>(
33+
extractors: &'a [Arc<dyn Extractor>],
34+
lang: &str,
35+
) -> Option<&'a Arc<dyn Extractor>> {
3336
extractors.iter().find(|e| e.language() == lang)
3437
}
3538

@@ -54,15 +57,23 @@ pub fn walk_options<'a>(
5457
/// Match a single path against the extractor registry, without walking the tree.
5558
/// Used for incremental (watcher-driven) syncs where the caller already knows
5659
/// which paths changed.
57-
pub fn match_extractor(path: &Utf8Path, ext_map: &ExtMap, opts: &WalkOptions<'_>) -> Option<Arc<dyn Extractor>> {
60+
pub fn match_extractor(
61+
path: &Utf8Path,
62+
ext_map: &ExtMap,
63+
opts: &WalkOptions<'_>,
64+
) -> Option<Arc<dyn Extractor>> {
5865
let ext = path.extension()?;
5966
if ext == "h" {
6067
return resolve_header_extractor(path, opts);
6168
}
6269
ext_map.get(ext).cloned()
6370
}
6471

65-
pub fn walk(root: &Utf8Path, extractors: &[Arc<dyn Extractor>], config: &ExtractConfig) -> Vec<FileMatch> {
72+
pub fn walk(
73+
root: &Utf8Path,
74+
extractors: &[Arc<dyn Extractor>],
75+
config: &ExtractConfig,
76+
) -> Vec<FileMatch> {
6677
let ext_map = build_ext_map(extractors);
6778
let opts = walk_options(extractors, config, root);
6879

crates/codegraph-extract/tests/extract.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ fn sync_paths_skips_mtime_only_touch() {
105105
)
106106
.unwrap();
107107

108-
orch.sync_paths(&fixture.parent().unwrap(), &db, std::slice::from_ref(&fixture))
109-
.unwrap();
108+
orch.sync_paths(
109+
fixture.parent().unwrap(),
110+
&db,
111+
std::slice::from_ref(&fixture),
112+
)
113+
.unwrap();
110114
let indexed = db.stats().unwrap().files;
111115
assert!(indexed >= 1, "fixture should be indexed");
112116

@@ -118,7 +122,11 @@ fn sync_paths_skips_mtime_only_touch() {
118122
.unwrap();
119123

120124
let stats = orch
121-
.sync_paths(&fixture.parent().unwrap(), &db, std::slice::from_ref(&fixture))
125+
.sync_paths(
126+
fixture.parent().unwrap(),
127+
&db,
128+
std::slice::from_ref(&fixture),
129+
)
122130
.unwrap();
123131
assert_eq!(stats.files, 0, "mtime-only touch must not re-index");
124132
assert!(stats.skipped >= 1, "expected skip, got {:?}", stats);

0 commit comments

Comments
 (0)