Skip to content

Commit

Permalink
fix(deps): update rust crate lopdf to 0.33.0 and pdf_extract to v0.7.8 (
Browse files Browse the repository at this point in the history
#206)

* fix(deps): update rust crate lopdf to 0.33.0

* updat pdf_extract to v0.7.8

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Prabir Shrestha <mail@prabir.me>
  • Loading branch information
renovate[bot] and prabirshrestha authored Aug 26, 2024
1 parent c86fe66 commit 92193fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
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

0 comments on commit 92193fe

Please sign in to comment.