aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-02 16:01:38 +0000
committerGitHub <[email protected]>2020-11-02 16:01:38 +0000
commitcb04f0c019bdd77406a7feb6ae7f4a17924d0693 (patch)
tree5bb833b20c4d66a3683ceeb60a922a86284d5ad6 /crates/assists/src
parent731b38fa3c1694648e6c8e60f61820f9783343eb (diff)
parentf5e7f07838975757703a7e00adb45ee43c2d9a1a (diff)
Merge #6440
6440: Deny unreachable pub r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/assists/src')
-rw-r--r--crates/assists/src/utils/import_assets.rs6
-rw-r--r--crates/assists/src/utils/insert_use.rs4
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/assists/src/utils/import_assets.rs b/crates/assists/src/utils/import_assets.rs
index 23db3a74b..f47edbb76 100644
--- a/crates/assists/src/utils/import_assets.rs
+++ b/crates/assists/src/utils/import_assets.rs
@@ -26,13 +26,13 @@ pub(crate) enum ImportCandidate {
26 26
27#[derive(Debug)] 27#[derive(Debug)]
28pub(crate) struct TraitImportCandidate { 28pub(crate) struct TraitImportCandidate {
29 pub ty: hir::Type, 29 pub(crate) ty: hir::Type,
30 pub name: ast::NameRef, 30 pub(crate) name: ast::NameRef,
31} 31}
32 32
33#[derive(Debug)] 33#[derive(Debug)]
34pub(crate) struct PathImportCandidate { 34pub(crate) struct PathImportCandidate {
35 pub name: ast::NameRef, 35 pub(crate) name: ast::NameRef,
36} 36}
37 37
38#[derive(Debug)] 38#[derive(Debug)]
diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs
index 033fbcedc..a76bd5ebf 100644
--- a/crates/assists/src/utils/insert_use.rs
+++ b/crates/assists/src/utils/insert_use.rs
@@ -17,13 +17,13 @@ use syntax::{
17use test_utils::mark; 17use test_utils::mark;
18 18
19#[derive(Debug)] 19#[derive(Debug)]
20pub enum ImportScope { 20pub(crate) enum ImportScope {
21 File(ast::SourceFile), 21 File(ast::SourceFile),
22 Module(ast::ItemList), 22 Module(ast::ItemList),
23} 23}
24 24
25impl ImportScope { 25impl ImportScope {
26 pub fn from(syntax: SyntaxNode) -> Option<Self> { 26 pub(crate) fn from(syntax: SyntaxNode) -> Option<Self> {
27 if let Some(module) = ast::Module::cast(syntax.clone()) { 27 if let Some(module) = ast::Module::cast(syntax.clone()) {
28 module.item_list().map(ImportScope::Module) 28 module.item_list().map(ImportScope::Module)
29 } else if let this @ Some(_) = ast::SourceFile::cast(syntax.clone()) { 29 } else if let this @ Some(_) = ast::SourceFile::cast(syntax.clone()) {