diff --git a/crates/kreuzberg/src/extraction/docx/parser.rs b/crates/kreuzberg/src/extraction/docx/parser.rs index e2fb8790a9..2684791085 100644 --- a/crates/kreuzberg/src/extraction/docx/parser.rs +++ b/crates/kreuzberg/src/extraction/docx/parser.rs @@ -1279,7 +1279,7 @@ impl DocxParser { b"w:fldChar" => { for attr in e.attributes().flatten() { if attr.key.as_ref() == b"w:fldCharType" { - match attr.value.as_ref() { + match attr.value.as_ref() as &[u8] { b"begin" => in_field_instruction = true, b"separate" | b"end" => in_field_instruction = false, _ => {} @@ -1413,7 +1413,7 @@ impl DocxParser { b"w:fldChar" => { for attr in e.attributes().flatten() { if attr.key.as_ref() == b"w:fldCharType" { - match attr.value.as_ref() { + match attr.value.as_ref() as &[u8] { b"begin" => in_field_instruction = true, b"separate" | b"end" => in_field_instruction = false, _ => {} diff --git a/crates/kreuzberg/src/extractors/fictionbook.rs b/crates/kreuzberg/src/extractors/fictionbook.rs index ddbb50f017..382180312d 100644 --- a/crates/kreuzberg/src/extractors/fictionbook.rs +++ b/crates/kreuzberg/src/extractors/fictionbook.rs @@ -109,7 +109,7 @@ impl FictionBookExtractor { let decoded = String::from_utf8_lossy(t.as_ref()).to_string(); let had_trailing_space = decoded.ends_with(char::is_whitespace); let normalized = crate::utils::normalize_whitespace(&decoded); - let trimmed = normalized.as_ref(); + let trimmed: &str = normalized.as_ref(); if !trimmed.is_empty() { let starts_with_punct = trimmed.starts_with(['.', ',', ';', ':', '!', '?', ')', ']', '[']); if !text.is_empty() && !text.ends_with(' ') && !text.ends_with('\n') && !starts_with_punct { @@ -828,7 +828,7 @@ impl FictionBookExtractor { Ok(Event::Text(t)) => { let decoded = String::from_utf8_lossy(t.as_ref()).to_string(); let normalized = crate::utils::normalize_whitespace(&decoded); - let trimmed = normalized.as_ref(); + let trimmed: &str = normalized.as_ref(); if !trimmed.is_empty() { if !text.is_empty() && !text.ends_with(' ') { text.push(' ');