aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-02 12:59:35 +0000
committerAleksey Kladov <[email protected]>2020-03-02 12:59:35 +0000
commit503ffb48931275f5c44471a1e0c1b2e7a599df43 (patch)
tree99633035713bf0ffa3c63f46ca5a6622770a959e
parent8f8980cedfc3f21b1a48b42a759796bd2d5a2dc3 (diff)
One more assert
-rw-r--r--crates/ra_assists/src/ast_transform.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs
index 0e53c1eee..42856f0ca 100644
--- a/crates/ra_assists/src/ast_transform.rs
+++ b/crates/ra_assists/src/ast_transform.rs
@@ -178,5 +178,10 @@ impl<'a> AstTransform<'a> for QualifyPaths<'a> {
178 178
179pub(crate) fn path_to_ast(path: hir::ModPath) -> ast::Path { 179pub(crate) fn path_to_ast(path: hir::ModPath) -> ast::Path {
180 let parse = ast::SourceFile::parse(&path.to_string()); 180 let parse = ast::SourceFile::parse(&path.to_string());
181 parse.tree().syntax().descendants().find_map(ast::Path::cast).unwrap() 181 parse
182 .tree()
183 .syntax()
184 .descendants()
185 .find_map(ast::Path::cast)
186 .unwrap_or_else(|| panic!("failed to parse path {:?}, `{}`", path, path))
182} 187}