Skip to content

Commit

Permalink
Preserve newlines in docstring description
Browse files Browse the repository at this point in the history
  • Loading branch information
sfisol committed Nov 26, 2020
1 parent 225bb7b commit d11096f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion macros/src/actix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,13 @@ fn extract_fn_documentation(
}
};
let summary = none_if_empty(summary.into_iter().collect::<String>().trim());
let description = none_if_empty(description.into_iter().collect::<String>().trim());
let description = none_if_empty(
description
.into_iter()
.map(|x| format!("{}\n", x))
.collect::<String>()
.trim(),
);
(summary, description)
}

Expand Down

0 comments on commit d11096f

Please sign in to comment.