Skip to content

Commit

Permalink
Merge pull request #126 from itchyny/fix-builder-doc-method-name
Browse files Browse the repository at this point in the history
Fix builder method link of the builder type
  • Loading branch information
idanarye committed Oct 29, 2023
2 parents 6fa90a0 + 3fb7501 commit 5930669
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions typed-builder-macro/src/struct_info.rs
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 5930669

Please sign in to comment.