style: code style
This commit is contained in:
@@ -9,16 +9,15 @@ pub struct Parser{
|
||||
|
||||
impl Parser {
|
||||
pub fn new(keyword: String, end_filter: Box<dyn Fn(Vec<char>) -> bool>) -> Parser {
|
||||
let callback = Box::from(|text : String, line : usize, file : &str| {
|
||||
let callback = Box::from(|text: String, line: usize, file: &str| {
|
||||
// let path = Path::new(file).strip_prefix(env::current_dir().unwrap().to_str().unwrap()).unwrap();
|
||||
println!("{} {} {} {} : {}", file, "TODO".green() ,"Line ".green(), line.to_string().green(), text.blue());
|
||||
});
|
||||
Parser{keyword: keyword, end_filter: end_filter, callback}
|
||||
Parser{ keyword, end_filter, callback }
|
||||
}
|
||||
|
||||
pub fn new_callback(keyword: String, end_filter: Box<dyn Fn(Vec<char>) -> bool>, callback: Box<dyn Fn(String, usize, &str)>) -> Parser {
|
||||
|
||||
Parser{ keyword: keyword, end_filter : end_filter, callback }
|
||||
Parser { keyword, end_filter, callback }
|
||||
}
|
||||
|
||||
fn get_keyword(&self) -> String {
|
||||
|
||||
Reference in New Issue
Block a user