diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 14:21:53 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 14:21:53 +0200 |
commit | 504729a4a0c8f3e0d8fc9159e0273150b169e184 (patch) | |
tree | a6bf291322decccd6011580337b1feed6151b554 /src/construct/partial_data.rs | |
parent | db5a491e6c2223d1db9b458307431a54db3c40f2 (diff) | |
download | markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.gz markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.bz2 markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.zip |
Refactor to improve docs of each function
Diffstat (limited to '')
-rw-r--r-- | src/construct/partial_data.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/construct/partial_data.rs b/src/construct/partial_data.rs index f9b7947..b6b0f59 100644 --- a/src/construct/partial_data.rs +++ b/src/construct/partial_data.rs @@ -11,7 +11,7 @@ use crate::resolve::Name as ResolveName; use crate::state::{Name as StateName, State}; use crate::tokenizer::Tokenizer; -/// At the beginning of data. +/// At beginning of data. /// /// ```markdown /// > | abc @@ -79,11 +79,10 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { /// Merge adjacent data events. pub fn resolve(tokenizer: &mut Tokenizer) { - let len = tokenizer.events.len(); let mut index = 0; // Loop through events and merge adjacent data events. - while index < len { + while index < tokenizer.events.len() { let event = &tokenizer.events[index]; if event.kind == Kind::Enter && event.name == Name::Data { @@ -91,7 +90,7 @@ pub fn resolve(tokenizer: &mut Tokenizer) { let mut exit_far_index = exit_index; // Find multiple `data` events. - while exit_far_index + 1 < len + while exit_far_index + 1 < tokenizer.events.len() && tokenizer.events[exit_far_index + 1].name == Name::Data { exit_far_index += 2; |