refactor: move line creation inside model

This commit is contained in:
graelo 2020-06-01 20:12:02 +02:00
parent 005fa7890f
commit aeca7223a6
3 changed files with 51 additions and 62 deletions

View file

@ -17,10 +17,8 @@ pub mod ui;
///
/// Maybe the decision to take ownership of the buffer is a bit bold.
pub fn run(buffer: String, opt: &CliOpt) -> Option<(String, bool)> {
let lines: Vec<&str> = buffer.split('\n').collect();
let mut model = model::Model::new(
&lines,
&buffer,
&opt.alphabet,
&opt.named_pattern,
&opt.custom_regex,