co-author 0.1.3

Co-Author your git commits from the command line
use crate::{common::err::SystemError, Result};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

type Lines = Vec<String>;

#[cfg_attr(test, mockall::automock)]
pub trait Reader {
	fn read_non_empty_lines(&self, path: &Path) -> Result<Lines>;
}

pub struct FileReader;

impl Reader for FileReader {
	fn read_non_empty_lines(&self, path: &Path) -> Result<Lines> {
		Ok(
			BufReader::new(File::open(path).map_err(|e| SystemError::Read(e.to_string()))?)
				.lines()
				.map_while(core::result::Result::ok)
				.filter(|line| !line.trim().is_empty())
				.collect(),
		)
	}
}