aboutsummaryrefslogtreecommitdiffstats
path: root/src/content
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-25 16:27:45 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-25 16:27:45 +0200
commit79fe341efc4d5e7467ec08cb7d0688b17a9efb05 (patch)
tree041c6fdf5821d27b8510005f847a3bf4488a3bf6 /src/content
parentca56f2742d8719358d2046fbdee4f1087add0568 (diff)
downloadmarkdown-rs-79fe341efc4d5e7467ec08cb7d0688b17a9efb05.tar.gz
markdown-rs-79fe341efc4d5e7467ec08cb7d0688b17a9efb05.tar.bz2
markdown-rs-79fe341efc4d5e7467ec08cb7d0688b17a9efb05.zip
Remove no longer needed field in `State::Ok`
Diffstat (limited to '')
-rw-r--r--src/content/document.rs6
-rw-r--r--src/content/flow.rs8
-rw-r--r--src/content/string.rs2
-rw-r--r--src/content/text.rs2
4 files changed, 8 insertions, 10 deletions
diff --git a/src/content/document.rs b/src/content/document.rs
index 29aaa84..d3159d3 100644
--- a/src/content/document.rs
+++ b/src/content/document.rs
@@ -383,9 +383,7 @@ fn flow_end(tokenizer: &mut Tokenizer, code: Code, mut info: DocumentInfo, resul
info.interrupt_before = tokenizer.interrupt;
match result {
- State::Ok(back) => {
- assert_eq!(back, 0);
-
+ State::Ok => {
if !info.stack.is_empty() {
info.continued = 0;
info = exit_containers(tokenizer, info, &Phase::Eof);
@@ -417,7 +415,7 @@ fn exit_containers(
let next = info.next;
info.next = Box::new(flow); // This is weird but Rust needs a function there.
let result = tokenizer.flush(next);
- assert!(matches!(result, State::Ok(0)));
+ assert!(matches!(result, State::Ok));
if *phase == Phase::Prefix {
info.index = tokenizer.events.len();
diff --git a/src/content/flow.rs b/src/content/flow.rs
index 8aed92b..2b2ee6d 100644
--- a/src/content/flow.rs
+++ b/src/content/flow.rs
@@ -41,7 +41,7 @@ use crate::tokenizer::{Code, State, Tokenizer};
/// ```
pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
_ => tokenizer.attempt(blank_line, |ok| {
Box::new(if ok { blank_line_after } else { initial_before })
})(tokenizer, code),
@@ -62,7 +62,7 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
/// ```
fn initial_before(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
_ => tokenizer.attempt_n(
vec![
Box::new(code_indented),
@@ -87,7 +87,7 @@ fn initial_before(tokenizer: &mut Tokenizer, code: Code) -> State {
/// ```
fn blank_line_after(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => {
tokenizer.enter(Token::BlankLineEnding);
tokenizer.consume(code);
@@ -111,7 +111,7 @@ fn blank_line_after(tokenizer: &mut Tokenizer, code: Code) -> State {
/// ```
fn after(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
Code::CarriageReturnLineFeed | Code::Char('\n' | '\r') => {
tokenizer.enter(Token::LineEnding);
tokenizer.consume(code);
diff --git a/src/content/string.rs b/src/content/string.rs
index fad2b6a..5a3149a 100644
--- a/src/content/string.rs
+++ b/src/content/string.rs
@@ -29,7 +29,7 @@ const MARKERS: [Code; 5] = [
/// Before string.
pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
_ => tokenizer.attempt_n(
vec![
Box::new(character_reference),
diff --git a/src/content/text.rs b/src/content/text.rs
index 0d90cb4..4e49a3d 100644
--- a/src/content/text.rs
+++ b/src/content/text.rs
@@ -47,7 +47,7 @@ const MARKERS: [Code; 12] = [
/// Before text.
pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
- Code::None => State::Ok(0),
+ Code::None => State::Ok,
_ => tokenizer.attempt_n(
vec![
Box::new(attention),