From 904fd470e29ad88de36f79fe6bdc31db0d3aaa55 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Tue, 5 Dec 2023 21:55:03 +0900 Subject: [PATCH] Refactor --- macro/src/dialect/operation.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/macro/src/dialect/operation.rs b/macro/src/dialect/operation.rs index 73affdbf61..ec96804430 100644 --- a/macro/src/dialect/operation.rs +++ b/macro/src/dialect/operation.rs @@ -576,14 +576,15 @@ impl<'a> Operation<'a> { summary: { let summary = definition.str_value("summary")?; - if summary.is_empty() { - format!("[`{short_name}`]({class_name}) operation.") - } else { - format!( - "[`{short_name}`]({class_name}) operation. {}.", - summary[0..1].to_uppercase() + &summary[1..] - ) - } + [ + format!("[`{short_name}`]({class_name}) operation."), + if summary.is_empty() { + Default::default() + } else { + summary[0..1].to_uppercase() + &summary[1..] + "." + }, + ] + .join(" ") }, description: unindent::unindent(definition.str_value("description")?), regions,