style: code style
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -54,7 +54,6 @@ fn main() -> std::io::Result<()> {
|
||||
|
||||
parsers.push(Parser::new(String::from("//fix"), Box::from(|x : Vec<char>| x.last().unwrap() == &'\n')));
|
||||
|
||||
|
||||
//loop on every file within the current dir
|
||||
for entry in match glob(&path) {
|
||||
Ok(entry) => entry,
|
||||
@@ -84,8 +83,7 @@ fn main() -> std::io::Result<()> {
|
||||
let mut path = String::from(dirs::home_dir().unwrap().to_str().unwrap());
|
||||
path.push_str("/.cargo/todo_config");
|
||||
// println!("{}",path);
|
||||
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||
where P: AsRef<Path>, {
|
||||
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>> where P: AsRef<Path> {
|
||||
let file = match File::open(&filename) {
|
||||
Ok(line) => line,
|
||||
Err(_) => {
|
||||
@@ -100,7 +98,7 @@ fn main() -> std::io::Result<()> {
|
||||
Ok(io::BufReader::new(file).lines())
|
||||
}
|
||||
|
||||
let mut regex = Vec::new();
|
||||
let mut regex = vec![];
|
||||
for line in read_lines(path).unwrap() {
|
||||
let line = line.unwrap();
|
||||
regex.push(line);
|
||||
@@ -115,7 +113,9 @@ fn main() -> std::io::Result<()> {
|
||||
println!("Couldn't access files. Error {}", e);
|
||||
Err(e).unwrap()
|
||||
}
|
||||
} {
|
||||
}
|
||||
|
||||
{
|
||||
let path = entry.unwrap();
|
||||
let path = Path::new(&path).strip_prefix(env::current_dir().unwrap().to_str().unwrap()).unwrap();
|
||||
// println!("{}", path.to_str().unwrap());
|
||||
|
||||
Reference in New Issue
Block a user