aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-05 13:31:46 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-05 13:31:46 +0200
commitf2d62d446a7b1e03ef14b580e2aca0fad8aa23ef (patch)
treeb2a837d99cb0e4a4de0bfd82051e10a2db8c6456 /src/parser.rs
parentfd860a975b84da9a79abfa247787e6adbd5ea34c (diff)
downloadmarkdown-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.rs5
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)
}