layered_nlp/ll_line/finish_with.rs
1use super::{LLCursorAssignment, LLSelection};
2
3pub trait FinishWith<T> {
4 fn finish_with<Attr, F: Fn(T) -> Attr>(self, f: F) -> Vec<LLCursorAssignment<Attr>>;
5}
6
7impl<T, I: IntoIterator<Item = (LLSelection, T)>> FinishWith<T> for I {
8 fn finish_with<Attr, F: Fn(T) -> Attr>(self, f: F) -> Vec<LLCursorAssignment<Attr>> {
9 self.into_iter()
10 .map(|(selection, t)| selection.finish_with_attr(f(t)))
11 .collect()
12 }
13}