You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel as though you added all that code outside the loop for fear that the lookup in matches is performed every loop iteration. Because matches isn't mut the compiler should only evaluate it once.
To get around this I recommend the structopt crate. This lets all of the variables you have be fields on a struct that are evaluated when the command first runs, thus avoiding the possibility that things like the regex in in until_match get evaluated every loop iteration.
I am currently creating a branch that does all this. It should simplify the code greatly.
I would also recommend using clippy and rustfmt on your code.
I'm new to Rust. I feel like I'm using
mut
in places I shouldn't. I need Rust pro to help me with code review.The text was updated successfully, but these errors were encountered: