style: code style
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -35,7 +35,7 @@ fn main() -> std::io::Result<()> {
|
||||
if let Some(_) = matches.subcommand_matches("legacy") {
|
||||
main_legacy()
|
||||
} 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());
|
||||
togo_config_path.push_str("/.cargo/todo_config");
|
||||
|
||||
@@ -49,7 +49,8 @@ fn main() -> std::io::Result<()> {
|
||||
all_rs_path.push_str("/**/*.rs");
|
||||
|
||||
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);
|
||||
Err(e).unwrap()
|
||||
}
|
||||
@@ -61,11 +62,9 @@ fn main() -> std::io::Result<()> {
|
||||
let file_path = path.to_str().unwrap();
|
||||
|
||||
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) {
|
||||
Ok(mut t) => {
|
||||
tokens.append(&mut t);
|
||||
},
|
||||
Ok(mut t) => tokens.append(&mut t),
|
||||
Err(e) => eprintln!{"{}", e},
|
||||
}
|
||||
}
|
||||
@@ -170,7 +169,8 @@ fn main_legacy() -> std::io::Result<()> {
|
||||
|
||||
//loop on every file within the current dir
|
||||
for entry in match glob(&path) {
|
||||
Ok(entry) => entry, Err(e) => {
|
||||
Ok(entry) => entry,
|
||||
Err(e) => {
|
||||
println!("Couldn't access files. Error {}", e);
|
||||
Err(e).unwrap()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user