diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-14 15:27:20 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-14 15:27:20 +0000 |
commit | 540edee3cd11d45a03abc072bb9b6f01b59bcb25 (patch) | |
tree | 7d86fca4364984808724ccc5694aef20a43d686c /crates/completion/src/item.rs | |
parent | aeacaeed4e49dd71ba0de30a21d9f3d1cc153cec (diff) | |
parent | 8dc68ecdfcc764c7c0dcf5fcedcb51b092d99620 (diff) |
Merge #7270
7270: Introduce more appropriate assertion mechanism r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/completion/src/item.rs')
-rw-r--r-- | crates/completion/src/item.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index 35af354b0..0134ff219 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs | |||
@@ -7,6 +7,7 @@ use ide_db::helpers::{ | |||
7 | insert_use::{self, ImportScope, MergeBehavior}, | 7 | insert_use::{self, ImportScope, MergeBehavior}, |
8 | mod_path_to_ast, SnippetCap, | 8 | mod_path_to_ast, SnippetCap, |
9 | }; | 9 | }; |
10 | use stdx::assert_never; | ||
10 | use syntax::{algo, TextRange}; | 11 | use syntax::{algo, TextRange}; |
11 | use text_edit::TextEdit; | 12 | use text_edit::TextEdit; |
12 | 13 | ||
@@ -396,6 +397,9 @@ impl Builder { | |||
396 | } | 397 | } |
397 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { | 398 | pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder { |
398 | self.detail = detail.map(Into::into); | 399 | self.detail = detail.map(Into::into); |
400 | if let Some(detail) = &self.detail { | ||
401 | assert_never!(detail.contains('\n'), "multiline detail: {}", detail); | ||
402 | } | ||
399 | self | 403 | self |
400 | } | 404 | } |
401 | #[allow(unused)] | 405 | #[allow(unused)] |