my fork of dmp
Example test-case failure - possible release candidate 0.3.2
Anubhab Bandyopadhyay 2024-11-07
parent 41b4c45 · commit 656b085
-rw-r--r--src/lib.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 29f5a61..7e4690e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -149,7 +149,7 @@
//! ### `Match` - fuzzy match of pattern in Text
//!
//! ```rust
-//! use diff_match_patch_rs::{DiffMatchPatch, Compat, Error, PatchInput};
+//! use diff_match_patch_rs::{DiffMatchPatch, Efficient, Error, PatchInput};
//! // This is the source text
//! const TXT: &str = "I am the very model of a modern Major-General, I've information on vegetable, animal, and mineral, 🚀👏👀";
//!
@@ -157,12 +157,13 @@
//! const PATTERN: &str = " that berry ";
//!
//! // Returns `location` of match if found, `None` if not found
-//! fn main() -> Option<usize> {
-//! let dmp = DiffMatchPatch::new();
+//! fn main() {
+//! let dmp = DiffMatchPatch::new();
//!
-//! // works with both `Efficient` and `Compat` modes
-//! // `5` here is an approx location to find `nearby` matches
-//! dmp.match_main::<Efficient>(TXT, PATTERN, 5) // this should return Some(4)
+//! // works with both `Efficient` and `Compat` modes
+//! // `5` here is an approx location to find `nearby` matches
+//! let res = dmp.match_main::<Efficient>(TXT, PATTERN, 5);
+//! println!("{:?}", res); // Should print `Some(4)`
//! }
//! ```
//!