aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/hard_break_trailing.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/construct/hard_break_trailing.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/construct/hard_break_trailing.rs b/src/construct/hard_break_trailing.rs
index c5861f7..8ce4201 100644
--- a/src/construct/hard_break_trailing.rs
+++ b/src/construct/hard_break_trailing.rs
@@ -42,7 +42,7 @@
use crate::constant::HARD_BREAK_PREFIX_SIZE_MIN;
use crate::token::Token;
-use crate::tokenizer::{Code, State, StateFnResult, Tokenizer};
+use crate::tokenizer::{Code, State, Tokenizer};
/// Start of a hard break (trailing).
///
@@ -51,15 +51,15 @@ use crate::tokenizer::{Code, State, StateFnResult, Tokenizer};
/// ^
/// | b
/// ```
-pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
+pub fn start(tokenizer: &mut Tokenizer, code: Code) -> State {
match code {
Code::Char(' ') if tokenizer.parse_state.constructs.hard_break_trailing => {
tokenizer.enter(Token::HardBreakTrailing);
tokenizer.enter(Token::HardBreakTrailingSpace);
tokenizer.consume(code);
- (State::Fn(Box::new(|t, c| inside(t, c, 1))), 0)
+ State::Fn(Box::new(|t, c| inside(t, c, 1)))
}
- _ => (State::Nok, 0),
+ _ => State::Nok,
}
}
@@ -70,19 +70,19 @@ pub fn start(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// ^
/// | b
/// ```
-fn inside(tokenizer: &mut Tokenizer, code: Code, size: usize) -> StateFnResult {
+fn inside(tokenizer: &mut Tokenizer, code: Code, size: usize) -> State {
match code {
Code::Char(' ') => {
tokenizer.consume(code);
- (State::Fn(Box::new(move |t, c| inside(t, c, size + 1))), 0)
+ State::Fn(Box::new(move |t, c| inside(t, c, size + 1)))
}
Code::CarriageReturnLineFeed | Code::Char('\n' | '\r')
if size >= HARD_BREAK_PREFIX_SIZE_MIN =>
{
tokenizer.exit(Token::HardBreakTrailingSpace);
tokenizer.exit(Token::HardBreakTrailing);
- (State::Ok, if matches!(code, Code::None) { 0 } else { 1 })
+ State::Ok(if matches!(code, Code::None) { 0 } else { 1 })
}
- _ => (State::Nok, 0),
+ _ => State::Nok,
}
}