diff --git a/runtime/src/file_data.rs b/runtime/src/file_data.rs index b42a4c12..97e27187 100644 --- a/runtime/src/file_data.rs +++ b/runtime/src/file_data.rs @@ -92,7 +92,7 @@ async fn stream_data(file_path: &str) -> Result { _ => match fmt.kind() { Kind::Document => match fmt { - FileFormat::PortableDocumentFormat => read_pdf(file_path).await?, + FileFormat::PortableDocumentFormat => stream_pdf(file_path).await?, FileFormat::MicrosoftWordDocument => { convert_with_pandoc(file_path, "docx", TO_MARKDOWN).await? } @@ -146,7 +146,7 @@ async fn stream_text_file(file_path: &str) -> Result { Ok(Box::pin(stream)) } -async fn read_pdf(file_path: &str) -> Result { +async fn stream_pdf(file_path: &str) -> Result { let path = file_path.to_owned(); let (tx, rx) = mpsc::channel(10);