slice_group_by/linear_str_group/
linear_str_group.rs1use crate::{LinearStrGroupBy, LinearStrGroupByMut};
2
3pub struct LinearStrGroup<'a>(LinearStrGroupBy<'a, fn(char, char) -> bool>);
10
11impl<'a> LinearStrGroup<'a> {
12 pub fn new(string: &'a str) -> Self {
13 LinearStrGroup(LinearStrGroupBy::new(string, |a, b| a == b))
14 }
15}
16
17str_group_by_wrapped!{ struct LinearStrGroup, &'a str }
18
19pub struct LinearStrGroupMut<'a>(LinearStrGroupByMut<'a, fn(char, char) -> bool>);
26
27impl<'a> LinearStrGroupMut<'a> {
28 pub fn new(string: &'a mut str) -> LinearStrGroupMut {
29 LinearStrGroupMut(LinearStrGroupByMut::new(string, |a, b| a == b))
30 }
31
32 #[inline]
33 pub fn as_str_mut(&mut self) -> &mut str {
34 self.0.as_str_mut()
35 }
36}
37
38str_group_by_wrapped!{ struct LinearStrGroupMut, &'a mut str }