Skip to content

Commit 8304f52

Browse files
committed
fix: address PR review comments
- Remove duplicate Cow imports in ocr.rs doctests - Add Default to ExtractionConfig derive list in api-rust.md - Use chars().take() instead of string slicing for UTF-8 safety - Fix code fence title syntax in disk_cache.rs snippet - Fix malformed markdown table in document-structure.md - Fix admonition indentation in api-elixir.md
1 parent 505cc2b commit 8304f52

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

crates/kreuzberg/src/plugins/ocr.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ pub enum OcrBackendType {
4545
/// use async_trait::async_trait;
4646
/// use std::borrow::Cow;
4747
/// use std::path::Path;
48-
/// use std::borrow::Cow;
4948
/// use kreuzberg::types::{ExtractionResult, Metadata};
5049
///
5150
/// struct CustomOcrBackend;
@@ -122,7 +121,6 @@ pub trait OcrBackend: Plugin {
122121
/// # use async_trait::async_trait;
123122
/// # use std::borrow::Cow;
124123
/// # use std::path::Path;
125-
/// # use std::borrow::Cow;
126124
/// # use kreuzberg::types::{ExtractionResult, Metadata};
127125
/// # struct MyOcr;
128126
/// # impl Plugin for MyOcr {
@@ -315,7 +313,6 @@ pub trait OcrBackend: Plugin {
315313
/// use std::borrow::Cow;
316314
/// use std::sync::Arc;
317315
/// use std::path::Path;
318-
/// use std::borrow::Cow;
319316
///
320317
/// struct CustomOcr;
321318
///

docs/guides/document-structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,10 @@ Page boundary marker in multi-page documents.
790790
Content layers classify nodes by their position and role in the document layout:
791791

792792
| Layer | Description | Typical Nodes | Example |
793-
| ------------ | ---------------------- | ------------------------------------------- | ------------------------ | -------- |
793+
| ------------ | ---------------------- | ------------------------------------------- | ------------------------ |
794794
| **body** | Main document content | Headings, paragraphs, lists, tables, images | Chapter text, sections |
795795
| **header** | Page header content | Title text, repeated headers | "Chapter 5: Advanced ML" |
796-
| **footer** | Page footer content | Page numbers, copyright | "© 2025 | Page 42" |
796+
| **footer** | Page footer content | Page numbers, copyright | "© 2025, Page 42" |
797797
| **footnote** | Footnotes and endnotes | Footnote text, references | "1. See Smith (2020)" |
798798

799799
Access content layer:

docs/reference/api-elixir.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ IO.inspect(atom)
838838
## Configuration
839839

840840
!!! warning "Deprecated API"
841-
The `force_ocr` parameter has been deprecated in favor of the new `ocr` configuration object.
841+
The `force_ocr` parameter has been deprecated in favor of the new `ocr` configuration object.
842842

843843
**Old pattern (no longer supported):**
844844
```elixir

docs/reference/api-rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ Main configuration struct for extraction operations.
378378
**Definition:**
379379

380380
```rust title="Rust"
381-
#[derive(Debug, Clone, Serialize, Deserialize)]
381+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
382382
pub struct ExtractionConfig {
383383
pub use_cache: bool,
384384
pub enable_quality_processing: bool,

docs/snippets/rust/advanced/advanced_config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ fn main() -> kreuzberg::Result<()> {
3333

3434
if let Some(chunks) = result.chunks {
3535
for chunk in chunks {
36-
println!("Chunk: {}...", &chunk.content[..100.min(chunk.content.len())]);
36+
let preview: String = chunk.content.chars().take(100).collect();
37+
println!("Chunk: {}...", preview);
3738
}
3839
}
3940

docs/snippets/rust/advanced/chunk_page_mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ format!("Page {}", first)
2323
} else {
2424
format!("Pages {}-{}", first, last)
2525
};
26-
println!("Chunk: {}... ({})", &chunk.content[..50.min(chunk.content.len())], page_range);
26+
println!("Chunk: {}... ({})", chunk.content.chars().take(50).collect::<String>(), page_range);
2727
}
2828
}
2929
}

docs/snippets/rust/cache/disk_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```rust title=r#"disk_cache.rs"#
1+
```rust title="disk_cache.rs"
22
use kreuzberg::{extract_file_sync, ExtractionConfig};
33

44
fn main() -> kreuzberg::Result<()> {

0 commit comments

Comments
 (0)