From b8b8322b9d21da476a136f1fe24a7a13c9c6aa70 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Fri, 30 Aug 2024 19:30:28 +0100 Subject: [PATCH] Run cargo fmt --- ocrs/src/lib.rs | 5 +++-- ocrs/src/recognition.rs | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ocrs/src/lib.rs b/ocrs/src/lib.rs index be1e478..0b81ba2 100644 --- a/ocrs/src/lib.rs +++ b/ocrs/src/lib.rs @@ -32,7 +32,6 @@ pub use text_items::{TextChar, TextItem, TextLine, TextWord}; // nb. The "E" before "ABCDE" should be the EUR symbol. const DEFAULT_ALPHABET: &str = " 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~EABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - /// Configuration for an [OcrEngine] instance. #[derive(Default)] pub struct OcrEngineParams { @@ -87,7 +86,9 @@ impl OcrEngine { recognizer, debug: params.debug, decode_method: params.decode_method, - alphabet: params.alphabet.unwrap_or_else(|| DEFAULT_ALPHABET.to_string()), + alphabet: params + .alphabet + .unwrap_or_else(|| DEFAULT_ALPHABET.to_string()), }) } diff --git a/ocrs/src/recognition.rs b/ocrs/src/recognition.rs index dcc04ab..b52a008 100644 --- a/ocrs/src/recognition.rs +++ b/ocrs/src/recognition.rs @@ -249,7 +249,10 @@ struct LineRecResult { /// for each line. /// /// Entries in the result may be `None` if no text was recognized for a line. -fn text_lines_from_recognition_results(results: &[LineRecResult], alphabet: &str) -> Vec> { +fn text_lines_from_recognition_results( + results: &[LineRecResult], + alphabet: &str, +) -> Vec> { results .iter() .map(|result| { @@ -298,7 +301,8 @@ fn text_lines_from_recognition_results(results: &[LineRecResult], alphabet: &str result.line.region.borrow(), start_x, end_x, - ).expect("invalid X coords"), + ) + .expect("invalid X coords"), }) }) .collect();