Skip to content

Commit

Permalink
Fix method names and links of generated documents
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Oct 29, 2023
1 parent 6fa90a0 commit 3fb7501
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions typed-builder-macro/src/struct_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ impl<'a> StructInfo<'a> {
"
Create a builder for building `{name}`.
On the builder, call {setters} to set the values of the fields.
Finally, call `.build()` to create the instance of `{name}`.
Finally, call `.{build_method_name}()` to create the instance of `{name}`.
",
name = self.name,
build_method_name = self.build_method_name(),
setters = {
let mut result = String::new();
let mut is_first = true;
Expand All @@ -156,8 +157,13 @@ impl<'a> StructInfo<'a> {
let builder_type_doc = if self.builder_attr.doc {
self.builder_attr.builder_type.get_doc_or(|| {
format!(
"Builder for [`{name}`] instances.\n\nSee [`{name}::builder()`] for more info.",
name = name
"
Builder for [`{name}`] instances.
See [`{name}::{builder_method_name}()`] for more info.
",
name = name,
builder_method_name = builder_method_name
)
})
} else {
Expand Down

0 comments on commit 3fb7501

Please sign in to comment.