Skip to content

Commit

Permalink
Fixing docstring format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattchine committed May 5, 2022
1 parent 1003e82 commit 08ec9c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion macros/src/types/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn format_variant(
let inline_type = variant_type.inline;

let doc = match doc_string {
Some(s) => format!("/** {} */ ", s),
Some(s) => format!("\n/**\n* {}\n*/\n", s),
None => "".to_string(),
};

Expand Down
2 changes: 1 addition & 1 deletion macros/src/types/named.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn format_field(
};

let doc_string = match doc_string {
Some(doc) => format!("/** {} */ ", doc),
Some(s) => format!("\n/**\n* {}\n*/\n", s),
None => "".to_string(),
};

Expand Down
2 changes: 1 addition & 1 deletion macros/src/types/newtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub(crate) fn newtype(
};

let doc = match doc_string {
Some(s) => format!("/** {} */ ", s),
Some(s) => format!("\n/**\n* {}\n*/\n", s),
None => "".to_string(),
};

Expand Down
2 changes: 1 addition & 1 deletion ts-rs/tests/doc_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ struct DocString {

#[test]
fn test() {
assert_eq!(DocString::inline(), "{ /** @mydoc */ a: number, /** @mydoc2 */ b: string, }");
assert_eq!(DocString::inline(), "{ \n/**\n* @mydoc\n*/\na: number, \n/**\n* @mydoc2\n*/\nb: string, }");
}

0 comments on commit 08ec9c5

Please sign in to comment.