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.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index b4ad26c13a..d1888d165c 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -641,9 +641,14 @@ pub fn fn_(
ret_type: Option<ast::RetType>,
is_async: bool,
) -> ast::Fn {
- let type_params =
- if let Some(type_params) = type_params { format!("<{}>", type_params) } else { "".into() };
- let ret_type = if let Some(ret_type) = ret_type { format!("{} ", ret_type) } else { "".into() };
+ let type_params = match type_params {
+ Some(type_params) => format!("<{}>", type_params),
+ None => "".into(),
+ };
+ let ret_type = match ret_type {
+ Some(ret_type) => format!("{} ", ret_type),
+ None => "".into(),
+ };
let visibility = match visibility {
None => String::new(),
Some(it) => format!("{} ", it),