Add `make::ext::expr_self`

Shortcut version of `make::expr_path(make::path_unqualified(make::path_segment_self()))`
This commit is contained in:
DropDemBits 2023-12-14 18:45:20 -05:00
parent 0e39257e5b
commit 039b3d0abb
No known key found for this signature in database
GPG Key ID: 7FE02A6C1EDFA075
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ pub mod ext {
pub fn expr_ty_new(ty: &ast::Type) -> ast::Expr { pub fn expr_ty_new(ty: &ast::Type) -> ast::Expr {
expr_from_text(&format!("{ty}::new()")) expr_from_text(&format!("{ty}::new()"))
} }
pub fn expr_self() -> ast::Expr {
expr_from_text("self")
}
pub fn zero_number() -> ast::Expr { pub fn zero_number() -> ast::Expr {
expr_from_text("0") expr_from_text("0")