mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
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.
This commit is contained in:
parent
680a0d54e4
commit
4f3c0adc5a
14 changed files with 104 additions and 117 deletions
|
@ -175,7 +175,7 @@ impl FunctionBuilder {
|
|||
}
|
||||
|
||||
fn render(self) -> FunctionTemplate {
|
||||
let placeholder_expr = make::expr_todo();
|
||||
let placeholder_expr = make::ext::expr_todo();
|
||||
let fn_body = make::block_expr(vec![], Some(placeholder_expr));
|
||||
let visibility = if self.needs_pub { Some(make::visibility_pub_crate()) } else { None };
|
||||
let mut fn_def = make::fn_(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue