Skip to content

Commit 71f0e07

Browse files
committed
Improve links in docs for generated named arguments structs
Probably needs rust-lang/rust#74563 for the original intended behaviour.
1 parent fcd8199 commit 71f0e07

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

binrw_derive/src/codegen/typed_builder.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ impl<'a> Builder<'a> {
4848

4949
let res_struct = if define_result {
5050
let docs = self.owner_name.map(|owner_name| {
51+
let (impl_name, impl_fn) = if self.is_write {
52+
("BinWrite", "write_options")
53+
} else {
54+
("BinRead", "read_options")
55+
};
5156
format!(
52-
"Named arguments for [`{}::{}`].",
57+
"Named arguments for the [`{0}::{1}`](::binrw::{0}::{1}) implementation of [`{2}`].",
58+
impl_name,
59+
impl_fn,
5360
owner_name,
54-
if self.is_write {
55-
"write_options"
56-
} else {
57-
"read_options"
58-
}
5961
)
6062
});
6163

0 commit comments

Comments
 (0)