fix(domain): the core builds with no feature again: restore_copy (worker import path) behind pdf-read, the layout test sink behind pdf-write; rust-check lints and builds the core alone (the workspace run unified the wasm crate's features and hid it)
This commit is contained in:
1 parent
9965d7f0a0
commit
a17ae45ed1
3 files changed
+7
No files matched your search
@@ -82,6 +82,7 @@ pub fn import_pdf(sheet: &LoadedSheet, bytes: &[u8]) -> String {
|
||||
/// BOM dropped, then `draft.restore` with no archive, including its OD-3 value budget. The
|
||||
/// kinds are `draft.restore`'s; a text that is not UTF-8 is `invalid`, as the application
|
||||
/// already called it (`error_invalid_copy`). Takes the bytes by value: the copy lives once.
|
||||
#[cfg(feature = "pdf-read")]
|
||||
pub fn restore_copy(sheet: &LoadedSheet, bytes: Vec<u8>) -> String {
|
||||
use crate::domain::session::restore_draft;
|
||||
use crate::ops::{over_value_budget, restore_failure};
|
||||
|
||||
@@ -98,11 +98,13 @@ pub fn latin1_bytes(text: &str) -> Vec<u8> {
|
||||
|
||||
/// An [`ImageSink`] for the layout oracles: keeps every PNG given, sized from its header,
|
||||
/// so the O1 `pngSha256` per embed index can be checked without a PDF writer.
|
||||
#[cfg(feature = "pdf-write")]
|
||||
#[derive(Default)]
|
||||
pub struct PngKeeper {
|
||||
pub pngs: Vec<Vec<u8>>,
|
||||
}
|
||||
|
||||
#[cfg(feature = "pdf-write")]
|
||||
impl faunosteo_core::pdf::write::layout::ImageSink for PngKeeper {
|
||||
fn embed(&mut self, png: &[u8]) -> Option<faunosteo_core::pdf::write::layout::Image> {
|
||||
let (width, height) = faunosteo_core::pdf::write::layout::png::dimensions(png)?;
|
||||
|
||||
@@ -15,6 +15,10 @@ cd "$(dirname "$0")/.."
|
||||
cargo fmt --all --check
|
||||
cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
cargo test --workspace --locked
|
||||
# The core alone with no feature (what the worker-side and any future consumer build): the
|
||||
# workspace run above unifies the wasm crate's features, so a code path that needs
|
||||
# `pdf-read` or `pdf-write` without its gate compiles there and nowhere else.
|
||||
cargo clippy -p faunosteo-core --all-targets --locked -- -D warnings
|
||||
# The PDF reader and writer (R4) are feature-gated in the core: their code and suites compile
|
||||
# only here and in the wasm module, never in the worker; `cli` adds the archive check tool
|
||||
# (`report-compare`, R4.7) and its O10 suite, never built into the module.
|
||||
|
||||
Reference in new issue
Block a user