1use std::{
4 fs::File,
5 io::{BufRead, BufReader, Lines},
6 path::Path,
7};
8
9use crate::error::ParserError;
10
11#[inline]
13pub fn get_lines<P>(filename: P) -> Result<Lines<BufReader<File>>, ParserError>
14where
15 P: AsRef<Path>,
16{
17 let file = File::open(filename)?;
18 Ok(BufReader::new(file).lines())
19}
20
21#[inline]
22pub fn get_reader<P>(filename: P) -> Result<BufReader<File>, ParserError>
23where
24 P: AsRef<Path>,
25{
26 let file = File::open(filename)?;
27 Ok(BufReader::new(file))
28}