Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/span/src/map.rs')
-rw-r--r--crates/span/src/map.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/span/src/map.rs b/crates/span/src/map.rs
index f58201793d..bb09933536 100644
--- a/crates/span/src/map.rs
+++ b/crates/span/src/map.rs
@@ -41,13 +41,13 @@ where
/// Pushes a new span onto the [`SpanMap`].
pub fn push(&mut self, offset: TextSize, span: SpanData<S>) {
- if cfg!(debug_assertions) {
- if let Some(&(last_offset, _)) = self.spans.last() {
- assert!(
- last_offset < offset,
- "last_offset({last_offset:?}) must be smaller than offset({offset:?})"
- );
- }
+ if cfg!(debug_assertions)
+ && let Some(&(last_offset, _)) = self.spans.last()
+ {
+ assert!(
+ last_offset < offset,
+ "last_offset({last_offset:?}) must be smaller than offset({offset:?})"
+ );
}
self.spans.push((offset, span));
}