Three format!("Field ...") call sites in the codegen produce
#[doc = "Field ..."] attributes, which prettyplease renders verbatim
as ///Field ... - no space after the slashes:
// from generated output:
///Field 1: `sentence`
pub sentence: &'a str,
Standard rustdoc style is /// Field 1: ... with a space.
Why
prettyplease emits ///X for #[doc = "X"] verbatim - no space
insertion (attr.rs:35-38).
rustfmt doesn't fix it either (roundtrips doc attrs as-is). To get
/// X the doc string itself needs a leading space.
Fix
Three sites, one-character change each:
buffa-codegen/src/message.rs:1057 - format!("Field ...") ->
format!(" Field ...")
buffa-codegen/src/view.rs:312 - same
buffa-codegen/src/view.rs:322 - same
For reference, connectrpc-codegen handles this with a doc_attrs()
helper that prefixes each non-blank line with a space before emitting
the #[doc = ...] attribute - worth considering if more doc-string
sites get added.
Three
format!("Field ...")call sites in the codegen produce#[doc = "Field ..."]attributes, which prettyplease renders verbatimas
///Field ...- no space after the slashes:Standard rustdoc style is
/// Field 1: ...with a space.Why
prettyplease emits
///Xfor#[doc = "X"]verbatim - no spaceinsertion (attr.rs:35-38).
rustfmt doesn't fix it either (roundtrips doc attrs as-is). To get
/// Xthe doc string itself needs a leading space.Fix
Three sites, one-character change each:
buffa-codegen/src/message.rs:1057-format!("Field ...")->format!(" Field ...")buffa-codegen/src/view.rs:312- samebuffa-codegen/src/view.rs:322- sameFor reference,
connectrpc-codegenhandles this with adoc_attrs()helper that prefixes each non-blank line with a space before emitting
the
#[doc = ...]attribute - worth considering if more doc-stringsites get added.