aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists')
-rw-r--r--crates/ra_assists/src/ast_editor.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_assists/src/ast_editor.rs b/crates/ra_assists/src/ast_editor.rs
index 5b6952426..076df98f2 100644
--- a/crates/ra_assists/src/ast_editor.rs
+++ b/crates/ra_assists/src/ast_editor.rs
@@ -19,7 +19,10 @@ pub struct AstEditor<N: AstNode> {
19} 19}
20 20
21impl<N: AstNode> AstEditor<N> { 21impl<N: AstNode> AstEditor<N> {
22 pub fn new(node: N) -> AstEditor<N> { 22 pub fn new(node: N) -> AstEditor<N>
23 where
24 N: Clone,
25 {
23 AstEditor { original_ast: node.clone(), ast: node } 26 AstEditor { original_ast: node.clone(), ast: node }
24 } 27 }
25 28
@@ -379,7 +382,7 @@ impl AstBuilder<ast::MatchArmList> {
379 382
380fn ast_node_from_file_text<N: AstNode>(text: &str) -> N { 383fn ast_node_from_file_text<N: AstNode>(text: &str) -> N {
381 let parse = SourceFile::parse(text); 384 let parse = SourceFile::parse(text);
382 let res = parse.tree().syntax().descendants().find_map(N::cast).unwrap().to_owned(); 385 let res = parse.tree().syntax().descendants().find_map(N::cast).unwrap();
383 res 386 res
384} 387}
385 388