diff options
author | Aleksey Kladov <[email protected]> | 2020-03-02 12:59:35 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-02 12:59:35 +0000 |
commit | 503ffb48931275f5c44471a1e0c1b2e7a599df43 (patch) | |
tree | 99633035713bf0ffa3c63f46ca5a6622770a959e | |
parent | 8f8980cedfc3f21b1a48b42a759796bd2d5a2dc3 (diff) |
One more assert
-rw-r--r-- | crates/ra_assists/src/ast_transform.rs | 7 |
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 | ||
179 | pub(crate) fn path_to_ast(path: hir::ModPath) -> ast::Path { | 179 | pub(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 | } |