Skip to content

Commit 53f9746

Browse files
carles-abarcaclaude
andcommitted
style: Apply rustfmt formatting
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent c52f70d commit 53f9746

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

crates/docling-rs-formats/csv/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! CSV backend for docling-rs
22
3+
use csv::ReaderBuilder;
34
use docling_rs_core::{
45
Backend, ConversionError, DoclingDocument, DocumentNode, DocumentSource, InputDocument,
56
InputFormat, NodeType,
67
};
7-
use csv::ReaderBuilder;
88
use std::io::Cursor;
99

1010
/// CSV backend
@@ -27,13 +27,13 @@ impl Backend for CsvBackend {
2727
fn convert(&self, input: &InputDocument) -> Result<DoclingDocument, ConversionError> {
2828
let content = match input.source() {
2929
DocumentSource::FilePath(path) => std::fs::read_to_string(path)?,
30-
DocumentSource::Bytes { data, .. } => {
31-
String::from_utf8(data.clone()).map_err(|e| ConversionError::ParseError(e.to_string()))?
32-
}
30+
DocumentSource::Bytes { data, .. } => String::from_utf8(data.clone())
31+
.map_err(|e| ConversionError::ParseError(e.to_string()))?,
3332
};
3433

3534
let name = match input.source() {
36-
DocumentSource::FilePath(path) => path.file_name()
35+
DocumentSource::FilePath(path) => path
36+
.file_name()
3737
.and_then(|n| n.to_str())
3838
.unwrap_or("document")
3939
.to_string(),

crates/docling-rs-formats/docx/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ impl Backend for DocxBackend {
3636
};
3737

3838
let name = match input.source() {
39-
DocumentSource::FilePath(path) => path.file_name()
39+
DocumentSource::FilePath(path) => path
40+
.file_name()
4041
.and_then(|n| n.to_str())
4142
.unwrap_or("document")
4243
.to_string(),

crates/docling-rs-formats/html/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ impl Backend for HtmlBackend {
2626
fn convert(&self, input: &InputDocument) -> Result<DoclingDocument, ConversionError> {
2727
let content = match input.source() {
2828
DocumentSource::FilePath(path) => std::fs::read_to_string(path)?,
29-
DocumentSource::Bytes { data, .. } => {
30-
String::from_utf8(data.clone()).map_err(|e| ConversionError::ParseError(e.to_string()))?
31-
}
29+
DocumentSource::Bytes { data, .. } => String::from_utf8(data.clone())
30+
.map_err(|e| ConversionError::ParseError(e.to_string()))?,
3231
};
3332

3433
let name = match input.source() {
35-
DocumentSource::FilePath(path) => path.file_name()
34+
DocumentSource::FilePath(path) => path
35+
.file_name()
3636
.and_then(|n| n.to_str())
3737
.unwrap_or("document")
3838
.to_string(),

crates/docling-rs-formats/xlsx/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! XLSX backend for docling-rs
22
3+
use calamine::{open_workbook_auto_from_rs, Reader, Sheets};
34
use docling_rs_core::{
45
Backend, ConversionError, DoclingDocument, DocumentNode, DocumentSource, InputDocument,
56
InputFormat, NodeType,
67
};
7-
use calamine::{open_workbook_auto_from_rs, Reader, Sheets};
88
use std::io::Cursor;
99

1010
/// XLSX backend using calamine
@@ -18,9 +18,7 @@ impl XlsxBackend {
1818

1919
fn get_bytes(input: &InputDocument) -> Result<Vec<u8>, ConversionError> {
2020
match input.source() {
21-
DocumentSource::FilePath(path) => {
22-
std::fs::read(path).map_err(ConversionError::Io)
23-
}
21+
DocumentSource::FilePath(path) => std::fs::read(path).map_err(ConversionError::Io),
2422
DocumentSource::Bytes { data, .. } => Ok(data.clone()),
2523
}
2624
}

crates/docling-rs/src/converter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//! Document converter - main entry point for document conversion
22
3-
use crate::{ConversionResult, ConversionError, InputDocument, InputFormat, Pipeline, SimplePipeline};
3+
use crate::{
4+
ConversionError, ConversionResult, InputDocument, InputFormat, Pipeline, SimplePipeline,
5+
};
46
use std::path::Path;
57

68
/// Main entry point for document conversion

0 commit comments

Comments
 (0)