From 039b3d0abbf1ff01229dcd58be458dc86ed06485 Mon Sep 17 00:00:00 2001 From: DropDemBits Date: Thu, 14 Dec 2023 18:45:20 -0500 Subject: [PATCH] Add `make::ext::expr_self` Shortcut version of `make::expr_path(make::path_unqualified(make::path_segment_self()))` --- crates/syntax/src/ast/make.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 764221fc8bf3..b6e5e6a4e42e 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -68,6 +68,9 @@ pub mod ext { pub fn expr_ty_new(ty: &ast::Type) -> ast::Expr { expr_from_text(&format!("{ty}::new()")) } + pub fn expr_self() -> ast::Expr { + expr_from_text("self") + } pub fn zero_number() -> ast::Expr { expr_from_text("0")