aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-27 20:22:20 +0000
committerAleksey Kladov <[email protected]>2019-11-27 20:22:20 +0000
commit1d14fd17372b42c3343daf6adc9a520fdf5e9810 (patch)
treef94102d2fd9431abaa5447315f152838db5bf9fc /crates/ra_ide/src
parentc0bb667a7dfaecfefacf0b3b6cb1e483aac6747a (diff)
Use Name::missing consistently
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/completion/presentation.rs5
-rw-r--r--crates/ra_ide/src/display/function_signature.rs7
2 files changed, 3 insertions, 9 deletions
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index 5f056730a..97475fc0b 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -267,10 +267,7 @@ impl Completions {
267 267
268 pub(crate) fn add_enum_variant(&mut self, ctx: &CompletionContext, variant: hir::EnumVariant) { 268 pub(crate) fn add_enum_variant(&mut self, ctx: &CompletionContext, variant: hir::EnumVariant) {
269 let is_deprecated = is_deprecated(variant, ctx.db); 269 let is_deprecated = is_deprecated(variant, ctx.db);
270 let name = match variant.name(ctx.db) { 270 let name = variant.name(ctx.db);
271 Some(it) => it,
272 None => return,
273 };
274 let detail_types = variant.fields(ctx.db).into_iter().map(|field| field.ty(ctx.db)); 271 let detail_types = variant.fields(ctx.db).into_iter().map(|field| field.ty(ctx.db));
275 let detail = join(detail_types.map(|t| t.display(ctx.db).to_string())) 272 let detail = join(detail_types.map(|t| t.display(ctx.db).to_string()))
276 .separator(", ") 273 .separator(", ")
diff --git a/crates/ra_ide/src/display/function_signature.rs b/crates/ra_ide/src/display/function_signature.rs
index d96de4e4c..324ad9552 100644
--- a/crates/ra_ide/src/display/function_signature.rs
+++ b/crates/ra_ide/src/display/function_signature.rs
@@ -93,12 +93,9 @@ impl FunctionSignature {
93 _ => (), 93 _ => (),
94 }; 94 };
95 95
96 let parent_name = match variant.parent_enum(db).name(db) { 96 let parent_name = variant.parent_enum(db).name(db).to_string();
97 Some(name) => name.to_string(),
98 None => "missing".into(),
99 };
100 97
101 let name = format!("{}::{}", parent_name, variant.name(db).unwrap()); 98 let name = format!("{}::{}", parent_name, variant.name(db));
102 99
103 let params = variant 100 let params = variant
104 .fields(db) 101 .fields(db)