dedup
Avril 4 years ago
parent bdf61340db
commit 5c784482f6
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -13,7 +13,7 @@ use std::{
#[derive(Debug)]
pub struct SentanceError;
/// A sentance
/// A sentence
#[derive(Debug, PartialEq, Eq)]
#[repr(transparent)]
pub struct Sentance(str);

@ -68,7 +68,8 @@ impl Word
}
/// Create a new iterator over words from this sentance.
pub fn new_iter<'a>(from: &'a (impl AsRef<Sentance> +?Sized+'a)) -> impl Iterator<Item = &'a Self>
pub fn new_iter<'a, 'b>(from: &'a (impl AsRef<Sentance> +?Sized+'b)) -> impl Iterator<Item = &'a Self>
where 'b: 'a
{
let from = from.as_ref();
from.split_inclusive(is_word_boundary)

Loading…
Cancel
Save