refactor: compile the crate once — main.rs uses the library
main.rs re-declared nearly every module (`mod ai; mod database; …`) that lib.rs also declared, so the ~100k-line crate compiled twice in every build (lib for the src/bin tools, bin for the server) and the test suite ran most tests twice. watcher.rs even reached into the lib copy via `image_api::` from inside the bin copy. The six bin-only modules (backfill, handlers, hls_stats, knowledge, reels, watcher) move into lib.rs; main.rs keeps only startup wiring over `use image_api::…`. A few items main calls become `pub`, and the dead_code allowances that only existed because each copy saw half the callers are gone. CLAUDE.md says not to reintroduce `mod` in main.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f35f87ea3
commit
640cd3833a
9 files changed
+27
-82
No files matched your search
+1
-2
@@ -1342,8 +1342,7 @@ pub struct RealFileSystem {
|
||||
}
|
||||
|
||||
impl RealFileSystem {
|
||||
#[allow(dead_code)] // Used in main.rs binary and tests
|
||||
pub(crate) fn new(base_path: String) -> RealFileSystem {
|
||||
pub fn new(base_path: String) -> RealFileSystem {
|
||||
RealFileSystem { base_path }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user