diff --git a/src/formatting.rs b/src/formatting.rs index bea3a6c..6a4640b 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -32,16 +32,10 @@ pub fn pretty_eval(input: &str, max_digits: usize) -> Result { } trait StrExt { - fn rsplit_once_last<'a>( - &'a self, - delimiters: &[&'static str], - ) -> (&'a str, &'static str, &'a str); + fn rsplit_once_last<'a, 'b>(&'a self, delimiters: &[&'b str]) -> (&'a str, &'b str, &'a str); } impl StrExt for str { - fn rsplit_once_last<'a>( - &'a self, - delimiters: &[&'static str], - ) -> (&'a str, &'static str, &'a str) { + fn rsplit_once_last<'a, 'b>(&'a self, delimiters: &[&'b str]) -> (&'a str, &'b str, &'a str) { delimiters .iter() .filter_map(|delimiter| self.rfind(delimiter).map(|i| (delimiter, i)))