From 58a6ec549d638455f5b5447bbbc174993e51e288 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 17 Apr 2021 21:34:14 +0200 Subject: Add some more error messages to fixture failure cases --- crates/base_db/src/fixture.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/base_db/src/fixture.rs') diff --git a/crates/base_db/src/fixture.rs b/crates/base_db/src/fixture.rs index 30f85bf3a..0132565e4 100644 --- a/crates/base_db/src/fixture.rs +++ b/crates/base_db/src/fixture.rs @@ -35,7 +35,7 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { fn with_position(ra_fixture: &str) -> (Self, FilePosition) { let (db, file_id, range_or_offset) = Self::with_range_or_offset(ra_fixture); let offset = match range_or_offset { - RangeOrOffset::Range(_) => panic!(), + RangeOrOffset::Range(_) => panic!("Expected a cursor position, got a range instead"), RangeOrOffset::Offset(it) => it, }; (db, FilePosition { file_id, offset }) @@ -45,7 +45,7 @@ pub trait WithFixture: Default + SourceDatabaseExt + 'static { let (db, file_id, range_or_offset) = Self::with_range_or_offset(ra_fixture); let range = match range_or_offset { RangeOrOffset::Range(it) => it, - RangeOrOffset::Offset(_) => panic!(), + RangeOrOffset::Offset(_) => panic!("Expected a cursor range, got a position instead"), }; (db, FileRange { file_id, range }) } -- cgit v1.2.3