Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten committed Dec 28, 2023
1 parent b458d12 commit 8d06483
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/document.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::slice::Iter;

use nom::{Finish, IResult};
use nom::IResult;

use crate::{blocks::Block, primitives::consume_empty_lines, Error, Span};

Expand Down Expand Up @@ -29,14 +29,7 @@ impl<'a> Document<'a> {
// TO DO: Look for document header.
// TO DO: Add option for best-guess parsing?

let _ = parse_blocks(i).finish();

let blocks = match parse_blocks(i) {
Ok((_, blocks)) => blocks,
Err(e) => {
return Err(e.into());
}
};
let (_rem, blocks) = parse_blocks(i)?;

// let blocks: Vec<Block<'a>> = vec![]; // TEMPORARY
Ok(Self { source, blocks })
Expand Down

0 comments on commit 8d06483

Please sign in to comment.