Commit ca1c158
committed
refactor: seal marker, smooth, scan_trial to pub(crate)
The #[doc(hidden)] pub mod hatch in lib.rs exposes 19 internal modules
to external callers who can reach them via mozjpeg_rs::foo::bar despite
the docs.rs hiding. That's intentional for modules like dct, consts,
trellis, quant, huffman, progressive — internal benches/examples/tests
and the sibling zenjpeg crate all import from them.
But three modules have zero external reach in benches, examples, tests,
or the sibling zenjpeg tree:
- marker (JPEG marker writer, 756 LOC)
- smooth (input smoothing filter, 227 LOC)
- scan_trial (sequential scan trial encoder, 443 LOC)
Seal those three to pub(crate) so they can't drift into the hidden
API surface. Keeps the #[allow(dead_code)] attribute on each — sealing
exposed some pre-existing dead code (MarkerWriter methods, scan_trial
bookkeeping fields) that's a separate cleanup concern.
Also delete MarkerWriter::get_ref — the one dead item with no callers
anywhere in the crate, found while chasing the sealing warnings.
types is NOT sealed in this commit: it exposes several pub items
(ColorSpace, CompressionProfile, DctMethod, ScanInfo, ComponentInfo,
QuantTable, HuffmanTable, DctBlock, SampleBlock, FloatBlock) that are
not re-exported at the crate root, so sealing could theoretically
break an external user reaching them via mozjpeg_rs::types::X. Left
for a follow-up that also triages the extra items.
cargo test --lib: 292 passed.1 parent 90a992d commit ca1c158
2 files changed
Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | 182 | | |
184 | | - | |
| 183 | + | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
203 | 201 | | |
204 | | - | |
| 202 | + | |
205 | 203 | | |
206 | 204 | | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
210 | 208 | | |
211 | 209 | | |
212 | | - | |
213 | 210 | | |
214 | | - | |
| 211 | + | |
215 | 212 | | |
216 | 213 | | |
217 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | 439 | | |
445 | 440 | | |
446 | 441 | | |
| |||
0 commit comments