Skip to content

Commit

Permalink
Fix comments and the clippy tests warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bnchi committed Oct 7, 2024
1 parent 567e7e0 commit 4c2703c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions mdast_util_to_markdown/src/configure.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
pub struct Options {
/// Marker to use for bullets of items in unordered lists ('*', '+', or '-', default: '*').
pub bullet: char,
// Marker to use in certain cases where the primary bullet doesn’t work
// ('*', '+', or '-', default: '-' when bullet is '*', '*' otherwise).
/// Marker to use in certain cases where the primary bullet doesn’t work
/// ('*', '+', or '-', default: '-' when bullet is '*', '*' otherwise).
pub bullet_other: char,
/// Marker to use for bullets of items in ordered lists ('.' or ')', default: '.').
pub bullet_ordered: char,
/// Marker to use for emphasis ('*' or '_', default: '*').
pub emphasis: char,
// Marker to use for fenced code ('`' or '~', default: '`').
/// Marker to use for fenced code ('`' or '~', default: '`').
pub fence: char,
/// Whether to use fenced code always (bool, default: true). The default is to use fenced code
/// if there is a language defined, if the code is empty, or if it starts or ends in blank lines.
pub fences: bool,
// How to indent the content of list items (default: 'IndentOptions::One').
/// How to indent the content of list items (default: 'IndentOptions::One').
pub list_item_indent: IndentOptions,
/// Marker to use for titles ('"' or "'", default: '"').
pub quote: char,
/// Marker to use for thematic breaks ('*', '-', or '_', default: '*').
pub rule: char,
// Marker to use for strong ('*' or '_', default: '*').
/// Marker to use for strong ('*' or '_', default: '*').
pub strong: char,
// Whether to increment the counter of ordered lists items (bool, default: true).
/// Whether to increment the counter of ordered lists items (bool, default: true).
pub increment_list_marker: bool,
/// Whether to add the same number of number signs (#) at the end of an ATX heading as the
/// opening sequence (bool, default: false).
Expand All @@ -37,16 +37,16 @@ pub struct Options {
pub setext: bool,
/// Whether to join definitions without a blank line (bool, default: false).
pub tight_definitions: bool,
// Number of markers to use for thematic breaks (u32, default: 3, min: 3).
/// Number of markers to use for thematic breaks (u32, default: 3, min: 3).
pub rule_repetition: u32,
}

#[derive(Copy, Clone)]
pub enum IndentOptions {
// Depends on the item and its parent list uses 'One' if the item and list are tight and 'Tab'
// otherwise.
/// Depends on the item and its parent list uses 'One' if the item and list are tight and 'Tab'
/// otherwise.
Mixed,
// The size of the bullet plus one space.
/// The size of the bullet plus one space.
One,
/// Tab stop.
Tab,
Expand Down
12 changes: 6 additions & 6 deletions mdast_util_to_markdown/src/construct_name.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#[derive(Clone, PartialEq)]
pub enum ConstructName {
///
//// Whole autolink.
////
//// ```markdown
//// > | <https://example.com> and <[email protected]>
//// ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
//// ```
/// Whole autolink.
///
/// ```markdown
/// > | <https://example.com> and <[email protected]>
/// ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
/// ```
Autolink,
///
/// Whole block quote.
Expand Down
2 changes: 1 addition & 1 deletion mdast_util_to_markdown/src/util/longest_char_streak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn longest_char_streak(haystack: &str, needle: char) -> usize {
}

#[cfg(test)]
mod longest_char_streak {
mod test {
use super::*;

#[test]
Expand Down
14 changes: 7 additions & 7 deletions mdast_util_to_markdown/tests/roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,37 +122,37 @@ fn roundtrip() {
let step1 = "\\ \\\\ \\\\\\ \\\\\\\\";
let step2 = "\\ \\ \\\\\\ \\\\\\\\\n";
assert_eq!(
to(&from(&step1, &Default::default()).unwrap()).unwrap(),
to(&from(step1, &Default::default()).unwrap()).unwrap(),
step2
);
assert_eq!(
to(&from(&step2, &Default::default()).unwrap()).unwrap(),
to(&from(step2, &Default::default()).unwrap()).unwrap(),
step2
);

let doc = "\\\\\\*a\n";
assert_eq!(to(&from(&doc, &Default::default()).unwrap()).unwrap(), doc);
assert_eq!(to(&from(doc, &Default::default()).unwrap()).unwrap(), doc);

let doc = "\\\\*a\\\\\\*";
assert_eq!(
remove_pos(&mut from(doc, &Default::default()).unwrap()),
remove_pos(
&mut from(
&to(&from(&doc, &Default::default()).unwrap()).unwrap(),
&to(&from(doc, &Default::default()).unwrap()).unwrap(),
&Default::default()
)
.unwrap()
)
);

let doc = "```\n \n```\n";
assert_eq!(to(&from(&doc, &Default::default()).unwrap()).unwrap(), doc);
assert_eq!(to(&from(doc, &Default::default()).unwrap()).unwrap(), doc);

let doc = "* * -\n";
assert_eq!(to(&from(&doc, &Default::default()).unwrap()).unwrap(), doc);
assert_eq!(to(&from(doc, &Default::default()).unwrap()).unwrap(), doc);

let doc = "- ***\n";
assert_eq!(to(&from(&doc, &Default::default()).unwrap()).unwrap(), doc);
assert_eq!(to(&from(doc, &Default::default()).unwrap()).unwrap(), doc);

let mut tree = from("* a\n- b", &Default::default()).unwrap();
assert_eq!(
Expand Down

0 comments on commit 4c2703c

Please sign in to comment.