diff --git a/src/compare/sexp.rs b/src/compare/sexp.rs index d06bbf0a..0cd558ec 100644 --- a/src/compare/sexp.rs +++ b/src/compare/sexp.rs @@ -106,8 +106,8 @@ fn is_slice_of(parent: &str, child: &str) -> bool { } /// Get a slice of the string that was consumed in a parser using the original input to the parser and the remaining input after the parser. -pub fn get_consumed<'s>(input: &'s str, remaining: &'s str) -> &'s str { - assert!(is_slice_of(input, remaining)); +fn get_consumed<'s>(input: &'s str, remaining: &'s str) -> &'s str { + debug_assert!(is_slice_of(input, remaining)); let source = { let offset = remaining.as_ptr() as usize - input.as_ptr() as usize; &input[..offset] diff --git a/src/parser/org_source.rs b/src/parser/org_source.rs index f38b85da..9f8c0f65 100644 --- a/src/parser/org_source.rs +++ b/src/parser/org_source.rs @@ -72,8 +72,8 @@ impl<'s> OrgSource<'s> { } pub(crate) fn get_until(&self, other: OrgSource<'s>) -> OrgSource<'s> { - assert!(other.start >= self.start); - assert!(other.end <= self.end); + debug_assert!(other.start >= self.start); + debug_assert!(other.end <= self.end); self.slice(..(other.start - self.start)) }