Compile the modules once, and clear the warning backlog
`cargo check --all-targets` emitted 32 warnings; it now emits none. Almost all of them came from one cause: main.rs declared `mod config/fleet/printer/uplink` while lib.rs declared the same modules, so every file was compiled twice, once per crate. In the binary copy nothing is externally reachable, so every `pub use` re-export and every method that only an example or a test calls was genuinely dead - and the warnings were real about the binary while being wrong about the library's actual public API. main.rs now uses the library crate and keeps only `mod go2rtc`, which nothing else needs. The rest, individually: - `ModuleInfo` was re-exported from bambu_commands but not from printer, so it was unreachable even though `GetVersionResponse.module` is a public field of type `Vec<ModuleInfo>` - a caller could not name the type of a field it can read. Re-exported rather than dropped. - Three stub `publish` impls take a payload they do not use yet; renamed to `_payload`. - One unused import in examples/test_bambu_certs.rs. That leaves the `async_fn_in_trait` lint on GenericPrinter, which is now `allow`ed with the reasoning written down rather than left to fire on every build. The old comment said it "only matters once this is wired into the multi-threaded daemon", which has since happened - so the question got answered instead of deferred: the futures cannot be required to be `Send`, and that is fine because every printer is reached through one Arc<Mutex<Vec<..>>> from the uplink's own task, so they are created and polled in the same place. The note says what to do if a printer ever gets its own task. No behaviour change. Tests still pass and the daemon was re-verified against the live P1P and H2C through the full backend path.
This commit is contained in:
+7
-4
@@ -1,7 +1,10 @@
|
||||
//! Library surface for `continuum-proxy`. The daemon itself is a binary
|
||||
//! (`src/main.rs`); this crate root exists so standalone examples (see
|
||||
//! `examples/`) and future integration tests can `use continuum_proxy::...`
|
||||
//! without duplicating module declarations.
|
||||
//! Library surface for `continuum-proxy`. The daemon itself is a thin binary
|
||||
//! (`src/main.rs`) that uses this crate; the examples in `examples/` and the
|
||||
//! integration tests in `tests/` use it too.
|
||||
//!
|
||||
//! Everything the daemon needs lives here rather than in the binary, so it is
|
||||
//! compiled once. `go2rtc` is the one exception: the camera-restreaming
|
||||
//! watchdog is the daemon's own concern and nothing else calls it.
|
||||
|
||||
pub mod config;
|
||||
pub mod fleet;
|
||||
|
||||
Reference in New Issue
Block a user