cos: drop the second decoded_strict_within that #6046 merged in (#6933)

main fails to compile (E0592): the merge of #6046 added Stream::decoded_strict_within next to the one already there. Both decode the whole chain bounded by max and map the error to CosError::Filter; the earlier one stays, with #6046's test.
This commit is contained in:
Dylan M. Taylor authored and GitHub committed 2026-11-10 18:54:55 -05:00
1 parent ad3e6d4b85
commit 9345b5caaa
1 file changed
-6
-6
View File
@@ -453,12 +453,6 @@ impl Stream {
self.decode_chain(max, decode).map(|(v, _)| v).map_err(|(e, _)| CosError::Filter(e.to_string())) self.decode_chain(max, decode).map(|(v, _)| v).map_err(|(e, _)| CosError::Filter(e.to_string()))
} }
/// [`Stream::decoded_strict`] for a caller with less than [`MAX_DECODED`] left to spend:
/// decoding past `max` bytes (in any filter stage) is an error.
pub fn decoded_strict_within(&self, max: usize) -> Result<Vec<u8>, CosError> {
self.decoded_strict_within_counted(max).map(|(v, _)| v).map_err(|(e, _)| CosError::Filter(e.to_string()))
}
/// [`Stream::decoded_strict`] bounded by `max` and counted like /// [`Stream::decoded_strict`] bounded by `max` and counted like
/// [`Stream::decoded_within_counted`]. /// [`Stream::decoded_within_counted`].
pub(crate) fn decoded_strict_within_counted(&self, max: usize) -> Result<(Vec<u8>, usize), (pdfcraft_filters::FilterError, usize)> { pub(crate) fn decoded_strict_within_counted(&self, max: usize) -> Result<(Vec<u8>, usize), (pdfcraft_filters::FilterError, usize)> {