chore: migrate from deprecated load_mem_with_password to load_mem_with_options

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-03-23 17:40:58 -07:00
co-authored by Claude Opus 4.6
parent fa94314760
commit ad10f670bf
4 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ pub fn extract_text_mem(buffer: &[u8]) -> Result<String, PdfError> {
let doc = match Document::load_mem(buffer) {
Ok(d) => d,
Err(ref e) if crate::is_encrypted_lopdf_error(e) => {
Document::load_mem_with_password(buffer, "")?
Document::load_mem_with_options(buffer, lopdf::LoadOptions::with_password(""))?
}
Err(e) => return Err(e.into()),
};
@@ -127,7 +127,7 @@ pub(crate) fn extract_text_with_positions_mem_and_rects(
let doc = match Document::load_mem(buffer) {
Ok(d) => d,
Err(ref e) if crate::is_encrypted_lopdf_error(e) => {
Document::load_mem_with_password(buffer, "")?
Document::load_mem_with_options(buffer, lopdf::LoadOptions::with_password(""))?
}
Err(e) => return Err(e.into()),
};