chore: Internal refactor to remove repeitition (#1144)
This commit is contained in:
+15
-1
@@ -197,6 +197,20 @@ impl Attributes {
|
||||
}
|
||||
}
|
||||
|
||||
fn format_method_name<T: Service>(
|
||||
package: &str,
|
||||
service: &T,
|
||||
method: &<T as Service>::Method,
|
||||
) -> String {
|
||||
format!(
|
||||
"{}{}{}.{}",
|
||||
package,
|
||||
if package.is_empty() { "" } else { "." },
|
||||
service.identifier(),
|
||||
method.identifier()
|
||||
)
|
||||
}
|
||||
|
||||
// Generates attributes given a list of (`pattern`, `attribute`) pairs. If `pattern` matches `name`, `attribute` will be included.
|
||||
fn generate_attributes<'a>(
|
||||
name: &str,
|
||||
@@ -218,7 +232,7 @@ fn generate_attributes<'a>(
|
||||
fn generate_doc_comment<S: AsRef<str>>(comment: S) -> TokenStream {
|
||||
let comment = comment.as_ref();
|
||||
|
||||
let comment = if !comment.starts_with(" ") {
|
||||
let comment = if !comment.starts_with(' ') {
|
||||
format!(" {}", comment)
|
||||
} else {
|
||||
comment.to_string()
|
||||
|
||||
Reference in New Issue
Block a user