diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:31:46 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:31:46 +0200 |
commit | f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef (patch) | |
tree | b2a837d99cb0e4a4de0bfd82051e10a2db8c6456 /src/parser.rs | |
parent | fd860a975b84da9a79abfa247787e6adbd5ea34c (diff) | |
download | markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.tar.gz markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.tar.bz2 markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.zip |
Refactor to do some to dos
Diffstat (limited to '')
-rw-r--r-- | src/parser.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/parser.rs b/src/parser.rs index 32689d6..69dd355 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -21,7 +21,7 @@ pub struct ParseState { /// Turn a string of markdown into events. /// /// Passes the codes back so the compiler can access the source. -pub fn parse(value: &str) -> (Vec<Event>, Vec<Code>) { +pub fn parse(value: &str) -> (Vec<Event>, ParseState) { let mut parse_state = ParseState { codes: parse_codes(value), definitions: HashSet::new(), @@ -37,6 +37,5 @@ pub fn parse(value: &str) -> (Vec<Event>, Vec<Code>) { 0, ); - // To do: pass whole `parse_state` back? - (events, parse_state.codes) + (events, parse_state) } |