From d35bda6429b0a3a758ddcd899e954043584f1071 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 26 Jan 2021 22:11:12 +0300 Subject: Make always-assert crate reusable --- crates/ide_db/src/source_change.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/ide_db/src/source_change.rs') diff --git a/crates/ide_db/src/source_change.rs b/crates/ide_db/src/source_change.rs index b1f87731b..f76bac151 100644 --- a/crates/ide_db/src/source_change.rs +++ b/crates/ide_db/src/source_change.rs @@ -10,7 +10,7 @@ use std::{ use base_db::{AnchoredPathBuf, FileId}; use rustc_hash::FxHashMap; -use stdx::assert_never; +use stdx::never; use text_edit::TextEdit; #[derive(Default, Debug, Clone)] @@ -40,10 +40,7 @@ impl SourceChange { pub fn insert_source_edit(&mut self, file_id: FileId, edit: TextEdit) { match self.source_file_edits.entry(file_id) { Entry::Occupied(mut entry) => { - assert_never!( - entry.get_mut().union(edit).is_err(), - "overlapping edits for same file" - ); + never!(entry.get_mut().union(edit).is_err(), "overlapping edits for same file"); } Entry::Vacant(entry) => { entry.insert(edit); -- cgit v1.2.3