diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:03:09 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:03:09 +0200 |
commit | fd860a975b84da9a79abfa247787e6adbd5ea34c (patch) | |
tree | bd9db168c57478f4f37c234eac4087c2d69a6445 /src/construct/partial_data.rs | |
parent | 0bc099f8f8b6541a962e604b7ac25445a2a9252a (diff) | |
download | markdown-rs-fd860a975b84da9a79abfa247787e6adbd5ea34c.tar.gz markdown-rs-fd860a975b84da9a79abfa247787e6adbd5ea34c.tar.bz2 markdown-rs-fd860a975b84da9a79abfa247787e6adbd5ea34c.zip |
Refactor code style
Diffstat (limited to 'src/construct/partial_data.rs')
-rw-r--r-- | src/construct/partial_data.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/construct/partial_data.rs b/src/construct/partial_data.rs index 9f99570..555ccaf 100644 --- a/src/construct/partial_data.rs +++ b/src/construct/partial_data.rs @@ -6,8 +6,6 @@ //! [string]: crate::content::string //! [text]: crate::content::text -// To do: pass token types in? - use crate::tokenizer::{Code, Event, EventType, State, StateFnResult, TokenType, Tokenizer}; use crate::util::edit_map::EditMap; @@ -34,7 +32,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code, stop: Vec<Code>) -> StateFnR fn at_break(tokenizer: &mut Tokenizer, code: Code, stop: Vec<Code>) -> StateFnResult { match code { Code::None => (State::Ok, None), - Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { + Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => { tokenizer.enter(TokenType::LineEnding); tokenizer.consume(code); tokenizer.exit(TokenType::LineEnding); @@ -58,7 +56,7 @@ fn at_break(tokenizer: &mut Tokenizer, code: Code, stop: Vec<Code>) -> StateFnRe /// ``` fn data(tokenizer: &mut Tokenizer, code: Code, stop: Vec<Code>) -> StateFnResult { let done = match code { - Code::None | Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => true, + Code::None | Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => true, _ if stop.contains(&code) => true, _ => false, }; |