Skip to content

Commit

Permalink
Improve links in docs for generated named arguments structs
Browse files Browse the repository at this point in the history
Probably needs rust-lang/rust#74563 for
the original intended behaviour.
  • Loading branch information
csnover committed Aug 30, 2022
1 parent 3f4f948 commit 78f427d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions binrw_derive/src/codegen/typed_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ impl<'a> Builder<'a> {

let res_struct = if define_result {
let docs = self.owner_name.map(|owner_name| {
let (impl_name, impl_fn) = if self.is_write {
("BinWrite", "write_options")
} else {
("BinRead", "read_options")
};
format!(
"Named arguments for [`{}::{}`].",
"Named arguments for the [`{0}::{1}`](::binrw::{0}::{1}) implementation of [`{2}`].",
impl_name,
impl_fn,
owner_name,
if self.is_write {
"write_options"
} else {
"read_options"
}
)
});

Expand Down

0 comments on commit 78f427d

Please sign in to comment.