From 4f3c0adc5aafea465c71c85f36484da970df1ba2 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 9 May 2021 19:51:06 +0300 Subject: internal: introduce `ast::make::ext` module with common shortcuts There's a tension between keeping a well-architectured minimal orthogonal set of constructs, and providing convenience functions. Relieve this pressure by introducing an dedicated module for non-orthogonal shortcuts. This is inspired by the django.shortcuts module which serves a similar purpose architecturally. --- crates/ide_assists/src/utils.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide_assists/src/utils.rs') diff --git a/crates/ide_assists/src/utils.rs b/crates/ide_assists/src/utils.rs index 5a90ad715..0dcf20c61 100644 --- a/crates/ide_assists/src/utils.rs +++ b/crates/ide_assists/src/utils.rs @@ -159,8 +159,8 @@ pub fn add_trait_assoc_items_to_impl( match fn_def.body() { Some(_) => fn_def, None => { - let body = - make::block_expr(None, Some(make::expr_todo())).indent(edit::IndentLevel(1)); + let body = make::block_expr(None, Some(make::ext::expr_todo())) + .indent(edit::IndentLevel(1)); fn_def.with_body(body) } } -- cgit v1.2.3