Repository: kkawakam/rustyline (language: rust)

Issue:
doc question
https://docs.rs/rustyline/latest/src/rustyline/history.rs.html#72

What' s difference between return Ok(true) and Ok(false)


Discussion / hints:
Ok(false) is for duplicates or blank lines or ...

Fix patch:
diff --git a/src/history.rs b/src/history.rs
index 0dc289db7..f3237d7aa 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -69,8 +69,14 @@ pub trait History {
     // reedline: fn append(&mut self, entry: &str);
 
     /// Add a new entry in the history.
+    ///
+    /// Return false if the `line` has been ignored (blank line / duplicate /
+    /// ...).
     fn add(&mut self, line: &str) -> Result<bool>;
     /// Add a new entry in the history.
+    ///
+    /// Return false if the `line` has been ignored (blank line / duplicate /
+    /// ...).
     fn add_owned(&mut self, line: String) -> Result<bool>; // TODO check AsRef<str> + Into<String> vs object safe
 
     /// Return the number of entries in the history.


Test patch: