Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update rust crate lopdf to 0.33.0 and pdf_extract to v0.7.8 #206

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ text-splitter = { version = "0.15", features = ["tiktoken-rs", "markdown"] }
surrealdb = { version = "1.4.2", optional = true, default-features = false }
csv = "1.3.0"
urlencoding = "2.1.3"
lopdf = { version = "0.32.0", features = ["nom_parser"], optional = true }
pdf-extract = { version = "0.7.7", optional = true }
lopdf = { version = "0.33.0", features = ["nom_parser"], optional = true }
pdf-extract = { version = "0.7.8", optional = true }
thiserror = "1.0.59"
futures-util = "0.3.30"
async-stream = "0.3.5"
Expand Down
6 changes: 5 additions & 1 deletion src/document_loaders/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ pub enum LoaderError {
#[error(transparent)]
CSVError(#[from] csv::Error),

#[cfg(feature = "lopdf")]
#[cfg(any(feature = "lopdf"))]
#[error(transparent)]
LoPdfError(#[from] lopdf::Error),

#[cfg(feature = "pdf-extract")]
#[error(transparent)]
PdfExtractError(#[from] pdf_extract::Error),

#[cfg(feature = "pdf-extract")]
#[error(transparent)]
PdfExtractOutputError(#[from] pdf_extract::OutputError),
Expand Down
6 changes: 3 additions & 3 deletions src/document_loaders/pdf_loader/pdf_extract_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{

#[derive(Debug, Clone)]
pub struct PdfExtractLoader {
document: lopdf::Document,
document: pdf_extract::Document,
}

impl PdfExtractLoader {
Expand All @@ -29,7 +29,7 @@ impl PdfExtractLoader {
/// ```
///
pub fn new<R: Read>(reader: R) -> Result<Self, LoaderError> {
let document = lopdf::Document::load_from(reader)?;
let document = pdf_extract::Document::load_from(reader)?;
Ok(Self { document })
}
/// Creates a new PdfLoader from a path to a PDF file.
Expand All @@ -42,7 +42,7 @@ impl PdfExtractLoader {
/// ```
///
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, LoaderError> {
let document = lopdf::Document::load(path)?;
let document = pdf_extract::Document::load(path)?;
Ok(Self { document })
}
}
Expand Down
Loading