diff options
author | Hocdoc <bernhardberger@gmx.at> | 2022-11-10 10:06:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 10:06:43 +0100 |
commit | 34ea2841df53a1aafafb01c887965469344552ba (patch) | |
tree | c21d303bd0ac12bc0b81ba41556694139c5b55a6 /src/construct | |
parent | 48823f080218d5a13dbde2ed152b8144de5afef8 (diff) | |
download | markdown-rs-34ea2841df53a1aafafb01c887965469344552ba.tar.gz markdown-rs-34ea2841df53a1aafafb01c887965469344552ba.tar.bz2 markdown-rs-34ea2841df53a1aafafb01c887965469344552ba.zip |
Refactor code-style for Rust 1.65
Closes GH-29.
Reviewed-by: Titus Wormer <tituswormer@gmail.com>
Co-authored-by: Bernhard Berger <bernhardberger3456@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | src/construct/gfm_autolink_literal.rs | 2 | ||||
-rw-r--r-- | src/construct/gfm_task_list_item_check.rs | 4 | ||||
-rw-r--r-- | src/construct/mdx_esm.rs | 2 | ||||
-rw-r--r-- | src/construct/partial_mdx_jsx.rs | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/construct/gfm_autolink_literal.rs b/src/construct/gfm_autolink_literal.rs index 5438e36..cc9194d 100644 --- a/src/construct/gfm_autolink_literal.rs +++ b/src/construct/gfm_autolink_literal.rs @@ -334,7 +334,7 @@ pub fn www_prefix_inside(tokenizer: &mut Tokenizer) -> State { /// ``` pub fn www_prefix_after(tokenizer: &mut Tokenizer) -> State { // If there is *anything*, we can link. - if tokenizer.current == None { + if tokenizer.current.is_none() { State::Nok } else { State::Ok diff --git a/src/construct/gfm_task_list_item_check.rs b/src/construct/gfm_task_list_item_check.rs index b30659a..3908f4b 100644 --- a/src/construct/gfm_task_list_item_check.rs +++ b/src/construct/gfm_task_list_item_check.rs @@ -61,7 +61,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { .tokenize_state .document_at_first_paragraph_of_list_item && tokenizer.current == Some(b'[') - && tokenizer.previous == None + && tokenizer.previous.is_none() { tokenizer.enter(Name::GfmTaskListItemCheck); tokenizer.enter(Name::GfmTaskListItemMarker); @@ -149,7 +149,7 @@ pub fn after(tokenizer: &mut Tokenizer) -> State { /// ``` pub fn after_space_or_tab(tokenizer: &mut Tokenizer) -> State { // End of paragraph, after whitespace, after check, is not okay. - if tokenizer.current == None { + if tokenizer.current.is_none() { State::Nok } else { State::Ok diff --git a/src/construct/mdx_esm.rs b/src/construct/mdx_esm.rs index 47e11a3..13d7991 100644 --- a/src/construct/mdx_esm.rs +++ b/src/construct/mdx_esm.rs @@ -216,7 +216,7 @@ fn parse_esm(tokenizer: &mut Tokenizer) -> State { State::Error(format!("{}:{}: {}", point.line, point.column, message)) } MdxSignal::Eof(message) => { - if tokenizer.current == None { + if tokenizer.current.is_none() { State::Error(format!( "{}:{}: {}", tokenizer.point.line, tokenizer.point.column, message diff --git a/src/construct/partial_mdx_jsx.rs b/src/construct/partial_mdx_jsx.rs index e654416..fc03f82 100644 --- a/src/construct/partial_mdx_jsx.rs +++ b/src/construct/partial_mdx_jsx.rs @@ -1119,7 +1119,7 @@ fn crash(tokenizer: &Tokenizer, at: &str, expect: &str) -> State { "{}:{}: Unexpected {} {}, expected {}", tokenizer.point.line, tokenizer.point.column, - format_char_opt(if tokenizer.current == None { + format_char_opt(if tokenizer.current.is_none() { None } else { char_after_index(tokenizer.parse_state.bytes, tokenizer.point.index) |