globbing in add and clean the function

This commit is contained in:
grimhilt
2023-10-28 15:44:53 +02:00
parent 56234eaa3d
commit d34b9bab5e
5 changed files with 70 additions and 17 deletions

View File

@@ -23,6 +23,13 @@ pub fn read_lines() -> Result<Vec<String>, ()> {
Ok(vec![])
}
pub fn get_rules() -> Vec<String> {
match read_lines() {
Ok(r) => r,
Err(_) => vec![],
}
}
pub fn _ignore_files(files: &mut Vec<String>) -> (bool, Vec<String>) {
let mut ignored_f = vec![];
if let Ok(lines) = read_lines() {
@@ -80,6 +87,7 @@ pub fn ignore_file(path: &String, lines: Vec<String>, ignored_f: &mut Vec<String
#[cfg(test)]
mod tests {
use super::*;
use std::io::Cursor;
#[test]
fn test_ignore_files() {