aboutsummaryrefslogtreecommitdiffstats
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 3361baf..1e689ee 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -10,8 +10,8 @@ use crate::{Constructs, Options};
/// Importantly, this contains a set of known definitions.
/// It also references the input value as [`Code`][]s.
#[derive(Debug)]
-pub struct ParseState {
- pub constructs: Constructs,
+pub struct ParseState<'a> {
+ pub constructs: &'a Constructs,
/// List of codes.
pub codes: Vec<Code>,
/// Set of defined identifiers.
@@ -21,9 +21,9 @@ 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, options: &Options) -> (Vec<Event>, ParseState) {
+pub fn parse<'a>(value: &str, options: &'a Options) -> (Vec<Event>, ParseState<'a>) {
let mut parse_state = ParseState {
- constructs: options.constructs.clone(),
+ constructs: &options.constructs,
codes: parse_codes(value),
definitions: vec![],
};