Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/ast/make.rs')
-rw-r--r--crates/syntax/src/ast/make.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index 16aa49e357..8b7f91c937 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -187,6 +187,9 @@ pub fn ty_tuple(types: impl IntoIterator<Item = ast::Type>) -> ast::Type {
ty_from_text(&format!("({contents})"))
}
+pub fn ty_paren(ty: ast::Type) -> ast::Type {
+ ty_from_text(&format!("({ty})"))
+}
pub fn ty_ref(target: ast::Type, exclusive: bool) -> ast::Type {
ty_from_text(&if exclusive { format!("&mut {target}") } else { format!("&{target}") })
}