diff --git a/Cargo.toml b/Cargo.toml index 97381a1..92748c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "markov" -version = "0.6.3" +version = "0.6.4" description = "Generate string of text from Markov chain fed by stdin" authors = ["Avril "] edition = "2018" diff --git a/src/sanitise/filter.rs b/src/sanitise/filter.rs index ddea8c0..cbc896b 100644 --- a/src/sanitise/filter.rs +++ b/src/sanitise/filter.rs @@ -178,7 +178,7 @@ impl Filter output } - pub fn filter_str<'a, T: AsRef+'a>(&'a self, string: &'a T) -> FilterStr<'a> + pub fn filter_str<'a, T: AsRef+'a +?Sized>(&'a self, string: &'a T) -> FilterStr<'a> { FilterStr(string.as_ref(), self, OnceCell::new()) } diff --git a/src/sanitise/sentance.rs b/src/sanitise/sentance.rs index 8da3d7d..edae602 100644 --- a/src/sanitise/sentance.rs +++ b/src/sanitise/sentance.rs @@ -68,7 +68,7 @@ impl Sentance } /// Create a new iterator over sentances from this string. - pub fn new_iter<'a>(from: &'a (impl AsRef +'a + ?Sized)) -> impl Iterator + pub fn new_iter<'a>(from: &'a (impl AsRef +'a + ?Sized)) -> impl Iterator + Clone { let from = from.as_ref(); from.split_inclusive(is_sentance_boundary) diff --git a/src/sentance.rs b/src/sentance.rs index 5ffeacb..41dd16d 100644 --- a/src/sentance.rs +++ b/src/sentance.rs @@ -17,9 +17,17 @@ pub async fn body(state: State, num: Option, mut output: mpsc::Sender x, + #[cold] None => return Ok(()), + }.to_owned())).await.map_err(|e| gen::GenBodyError(e.0))?; } Ok(()) }