aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/partial_bom.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 13:45:24 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-11 13:45:24 +0200
commit6eb2f644057f371841fe25330a57ee185f91c7af (patch)
tree7b4d02586339d1a7f82104b4473d9ac243b3abf9 /src/construct/partial_bom.rs
parent2d35cbfceace81a217cd0fbdae7a8777c7a6465e (diff)
downloadmarkdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.tar.gz
markdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.tar.bz2
markdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.zip
Refactor to move some code to `state.rs`
Diffstat (limited to 'src/construct/partial_bom.rs')
-rw-r--r--src/construct/partial_bom.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/construct/partial_bom.rs b/src/construct/partial_bom.rs
index d20c2c7..cca0770 100644
--- a/src/construct/partial_bom.rs
+++ b/src/construct/partial_bom.rs
@@ -10,8 +10,9 @@
//!
//! * [`micromark/lib/preprocess.js` in `micromark`](https://github.com/micromark/micromark/blob/ed23453/packages/micromark/dev/lib/preprocess.js#L54-L60)
+use crate::state::{Name, State};
use crate::token::Token;
-use crate::tokenizer::{State, StateName, Tokenizer};
+use crate::tokenizer::Tokenizer;
const BOM: [u8; 3] = [0xEF, 0xBB, 0xBF];
@@ -24,7 +25,7 @@ const BOM: [u8; 3] = [0xEF, 0xBB, 0xBF];
pub fn start(tokenizer: &mut Tokenizer) -> State {
if tokenizer.current == Some(BOM[0]) {
tokenizer.enter(Token::ByteOrderMark);
- State::Retry(StateName::BomInside)
+ State::Retry(Name::BomInside)
} else {
State::Nok
}
@@ -45,7 +46,7 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State {
tokenizer.tokenize_state.size = 0;
State::Ok
} else {
- State::Next(StateName::BomInside)
+ State::Next(Name::BomInside)
}
} else {
tokenizer.tokenize_state.size = 0;