From a60168e674e04d308a92ff77a6430dbe2ac3a6a1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 18 Jan 2021 15:58:10 +0300 Subject: Use assert_never properly --- crates/completion/src/item.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/completion') diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index 0134ff219..5d91d3a5c 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs @@ -398,7 +398,9 @@ impl Builder { pub(crate) fn set_detail(mut self, detail: Option>) -> Builder { self.detail = detail.map(Into::into); if let Some(detail) = &self.detail { - assert_never!(detail.contains('\n'), "multiline detail: {}", detail); + if assert_never!(detail.contains('\n'), "multiline detail: {}", detail) { + self.detail = Some(detail.splitn(2, '\n').next().unwrap().to_string()); + } } self } -- cgit v1.2.3