Skip to content

Commit 1b54056

Browse files
bors[bot]matklad
andauthored
Merge #7322
7322: Use assert_never properly r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 1f53026 + a60168e commit 1b54056

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/completion/src/item.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ impl Builder {
398398
pub(crate) fn set_detail(mut self, detail: Option<impl Into<String>>) -> Builder {
399399
self.detail = detail.map(Into::into);
400400
if let Some(detail) = &self.detail {
401-
assert_never!(detail.contains('\n'), "multiline detail: {}", detail);
401+
if assert_never!(detail.contains('\n'), "multiline detail: {}", detail) {
402+
self.detail = Some(detail.splitn(2, '\n').next().unwrap().to_string());
403+
}
402404
}
403405
self
404406
}

0 commit comments

Comments
 (0)