pub(super) fn extract(bytes: &[u8]) -> Result<String, String> {
pdf_extract::extract_text_from_mem(bytes)
.map_err(|e| format!("failed to extract PDF text: {e}"))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn garbage_bytes_report_error() {
let err = extract(b"not a pdf at all").unwrap_err();
assert!(!err.is_empty(), "{err}");
}
}