api-macro: trim doc-comment when used as description

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-11-26 12:17:40 +01:00
parent 5a2fe67cd8
commit 5b41f68891

View File

@ -487,7 +487,7 @@ pub(crate) fn api(_attr: TokenStream, item: TokenStream) -> Result<TokenStream,
input_schema.ok_or_else(|| format_err!(sig_span, "missing input schema"))?;
if input_schema.description.is_none() {
input_schema.description = Some(syn::LitStr::new(&doc_comment, doc_span));
input_schema.description = Some(syn::LitStr::new(doc_comment.trim(), doc_span));
}
let input_schema = {