diff options
author | Nick Spain <[email protected]> | 2021-01-01 06:26:39 +0000 |
---|---|---|
committer | Nick Spain <[email protected]> | 2021-01-02 10:53:52 +0000 |
commit | 7bfec89cf969aa630f184f7d4a66e8e12a423d2f (patch) | |
tree | 33ec5670269ef176c903db752aaadb16314ecb9a /crates/completion/src/completions.rs | |
parent | 3f1b3df65bee923e5de0652ea4b676530da29127 (diff) |
Make the result of Const, FunctionRender and TypeAliasRender constructors optional
They use source() which now returns an Option so they need to too.
Diffstat (limited to 'crates/completion/src/completions.rs')
-rw-r--r-- | crates/completion/src/completions.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/completion/src/completions.rs b/crates/completion/src/completions.rs index d9fe13485..00c9e76f0 100644 --- a/crates/completion/src/completions.rs +++ b/crates/completion/src/completions.rs | |||
@@ -106,8 +106,9 @@ impl Completions { | |||
106 | func: hir::Function, | 106 | func: hir::Function, |
107 | local_name: Option<String>, | 107 | local_name: Option<String>, |
108 | ) { | 108 | ) { |
109 | let item = render_fn(RenderContext::new(ctx), None, local_name, func); | 109 | if let Some(item) = render_fn(RenderContext::new(ctx), None, local_name, func) { |
110 | self.add(item) | 110 | self.add(item) |
111 | } | ||
111 | } | 112 | } |
112 | 113 | ||
113 | pub(crate) fn add_variant_pat( | 114 | pub(crate) fn add_variant_pat( |