mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 22:46:39 +01:00
Keep the \n
in the doc
comment as it is (don't replace it to newline)
This commit is contained in:
parent
4fe40f48b1
commit
9545075023
2 changed files with 4 additions and 4 deletions
|
@ -154,7 +154,7 @@ pub(crate) fn parse_doc_comment(attr: &Attribute) -> Option<String> {
|
|||
if let syn::Meta::NameValue(syn::MetaNameValue { lit: syn::Lit::Str(s), .. }) =
|
||||
attr.parse_meta().ok()?
|
||||
{
|
||||
return Some(s.value().trim().replace(r"\n", "\n"));
|
||||
return Some(s.value().trim().to_owned());
|
||||
}
|
||||
}
|
||||
None
|
||||
|
|
|
@ -250,7 +250,7 @@ fn description_with_doc_attr() {
|
|||
enum DefaultCommands {
|
||||
/// Start command
|
||||
Start,
|
||||
/// Help command\nwith new line
|
||||
/// Help command\nwithout replace the `\n`
|
||||
Help,
|
||||
/// Foo command
|
||||
/// with new line
|
||||
|
@ -259,8 +259,8 @@ fn description_with_doc_attr() {
|
|||
|
||||
assert_eq!(
|
||||
DefaultCommands::descriptions().to_string(),
|
||||
"/start — Start command\n/help — Help command\nwith new line\n/foo — Foo command\nwith \
|
||||
new line"
|
||||
"/start — Start command\n/help — Help command\\nwithout replace the `\\n`\n/foo — Foo \
|
||||
command\nwith new line"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue