diff --git a/src/splitting.rs b/src/splitting.rs index fbb06396..01e905f3 100644 --- a/src/splitting.rs +++ b/src/splitting.rs @@ -30,20 +30,13 @@ pub trait WordSplitter: std::fmt::Debug { fn split_points(&self, word: &str) -> Vec; } -impl WordSplitter for Box { +impl WordSplitter for Box { fn split_points(&self, word: &str) -> Vec { use std::ops::Deref; self.deref().split_points(word) } } -/* Alternative, also adds impls for specific Box i.e. Box -impl WordSplitter for Box { - fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)> { - use std::ops::Deref; - self.deref().split(word) - } -} -*/ + impl WordSplitter for &T { fn split_points(&self, word: &str) -> Vec { (*self).split_points(word)