Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/snippet.rs')
-rw-r--r--crates/ide_completion/src/snippet.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide_completion/src/snippet.rs b/crates/ide_completion/src/snippet.rs
index 1bcb128fa9..8100487a72 100644
--- a/crates/ide_completion/src/snippet.rs
+++ b/crates/ide_completion/src/snippet.rs
@@ -41,7 +41,7 @@ impl Snippet {
snippet: &[String],
description: &[String],
requires: &[String],
- scope: Option<SnippetScope>,
+ scope: SnippetScope,
) -> Option<Self> {
// validate that these are indeed simple paths
if requires.iter().any(|path| match ast::Path::parse(path) {
@@ -57,7 +57,7 @@ impl Snippet {
let description = description.iter().join("\n");
let description = if description.is_empty() { None } else { Some(description) };
Some(Snippet {
- scope: scope.unwrap_or(SnippetScope::Expr),
+ scope,
label,
snippet,
description,
@@ -89,7 +89,7 @@ impl PostfixSnippet {
snippet: &[String],
description: &[String],
requires: &[String],
- scope: Option<PostfixSnippetScope>,
+ scope: PostfixSnippetScope,
) -> Option<Self> {
// validate that these are indeed simple paths
if requires.iter().any(|path| match ast::Path::parse(path) {
@@ -105,7 +105,7 @@ impl PostfixSnippet {
let description = description.iter().join("\n");
let description = if description.is_empty() { None } else { Some(description) };
Some(PostfixSnippet {
- scope: scope.unwrap_or(PostfixSnippetScope::Expr),
+ scope,
label,
snippet,
description,