diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-18 16:34:56 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-18 16:35:00 +0200 |
commit | 7186ce91784a647b3015e04b55a95b109deceeb3 (patch) | |
tree | 79e9c0bf255826a2aca0e27b324e120facaf972e /src/lib.rs | |
parent | 5403261e8213f68633a09fc3e9bc2e6e2cd777b2 (diff) | |
download | markdown-rs-7186ce91784a647b3015e04b55a95b109deceeb3.tar.gz markdown-rs-7186ce91784a647b3015e04b55a95b109deceeb3.tar.bz2 markdown-rs-7186ce91784a647b3015e04b55a95b109deceeb3.zip |
Change to improve `default_line_ending` api
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -20,7 +20,7 @@ use crate::parser::parse; use crate::tokenizer::Code; /// Type of line endings in markdown. -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Default, Clone, PartialEq)] pub enum LineEnding { /// Both a carriage return (`\r`) and a line feed (`\n`). /// @@ -48,6 +48,7 @@ pub enum LineEnding { /// a␊ /// b /// ``` + #[default] LineFeed, } @@ -349,15 +350,14 @@ pub struct Options { /// micromark_with_options( /// "> a", /// &Options { - /// default_line_ending: Some(LineEnding::CarriageReturnLineFeed), + /// default_line_ending: LineEnding::CarriageReturnLineFeed, /// ..Options::default() /// } /// ), /// "<blockquote>\r\n<p>a</p>\r\n</blockquote>" /// ); /// ``` - // To do: use `default`? <https://doc.rust-lang.org/std/default/trait.Default.html#enums> - pub default_line_ending: Option<LineEnding>, + pub default_line_ending: LineEnding, /// Which constructs to enable and disable. /// The default is to follow `CommonMark`. |