style: code style
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -35,7 +35,7 @@ fn main() -> std::io::Result<()> {
|
|||||||
if let Some(_) = matches.subcommand_matches("legacy") {
|
if let Some(_) = matches.subcommand_matches("legacy") {
|
||||||
main_legacy()
|
main_legacy()
|
||||||
} else {
|
} else {
|
||||||
let mut tokens : Vec<Token> = Vec::new();
|
let mut tokens : Vec<Token> = vec![];
|
||||||
let mut togo_config_path = String::from(dirs::home_dir().unwrap().to_str().unwrap());
|
let mut togo_config_path = String::from(dirs::home_dir().unwrap().to_str().unwrap());
|
||||||
togo_config_path.push_str("/.cargo/todo_config");
|
togo_config_path.push_str("/.cargo/todo_config");
|
||||||
|
|
||||||
@@ -49,7 +49,8 @@ fn main() -> std::io::Result<()> {
|
|||||||
all_rs_path.push_str("/**/*.rs");
|
all_rs_path.push_str("/**/*.rs");
|
||||||
|
|
||||||
for entry in match glob(&all_rs_path) {
|
for entry in match glob(&all_rs_path) {
|
||||||
Ok(entry) => entry, Err(e) => {
|
Ok(entry) => entry,
|
||||||
|
Err(e) => {
|
||||||
println!("Couldn't access files. Error {}", e);
|
println!("Couldn't access files. Error {}", e);
|
||||||
Err(e).unwrap()
|
Err(e).unwrap()
|
||||||
}
|
}
|
||||||
@@ -63,9 +64,7 @@ fn main() -> std::io::Result<()> {
|
|||||||
let verbose_count = matches.occurrences_of("verbose");
|
let verbose_count = matches.occurrences_of("verbose");
|
||||||
let verbosity = if verbose_count == 0 || verbose_count == 2 { 2 } else { 1 };
|
let verbosity = if verbose_count == 0 || verbose_count == 2 { 2 } else { 1 };
|
||||||
match regex_parser(file_path, ®ex, verbosity) {
|
match regex_parser(file_path, ®ex, verbosity) {
|
||||||
Ok(mut t) => {
|
Ok(mut t) => tokens.append(&mut t),
|
||||||
tokens.append(&mut t);
|
|
||||||
},
|
|
||||||
Err(e) => eprintln!{"{}", e},
|
Err(e) => eprintln!{"{}", e},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,7 +169,8 @@ fn main_legacy() -> std::io::Result<()> {
|
|||||||
|
|
||||||
//loop on every file within the current dir
|
//loop on every file within the current dir
|
||||||
for entry in match glob(&path) {
|
for entry in match glob(&path) {
|
||||||
Ok(entry) => entry, Err(e) => {
|
Ok(entry) => entry,
|
||||||
|
Err(e) => {
|
||||||
println!("Couldn't access files. Error {}", e);
|
println!("Couldn't access files. Error {}", e);
|
||||||
Err(e).unwrap()
|
Err(e).unwrap()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user