diff --git a/src/data/cel/strings.rs b/src/data/cel/strings.rs index bbd35a0..d8bfe90 100644 --- a/src/data/cel/strings.rs +++ b/src/data/cel/strings.rs @@ -253,18 +253,10 @@ pub fn substring(This(this): This>, Arguments(args): Arguments) -> R message: format!("Can't have end be before the start: `{end} < {start}"), })? } - end -= start; Ok(this .chars() .skip(start) - .take_while(|_| { - if let Some(v) = end.checked_sub(1) { - end = v; - true - } else { - false - } - }) + .take(end - start) .collect::() .into()) }