Open LorenzSchueler opened 11 months ago
Sorry for not getting back to this. I've only had time to skim over the changes as there was lots of private and work related stuff going on. There are lots of nice improvements regarding the code and where I obviously didn't know about some functions or how to do it properly with Rust. I definitely want to understand what has been changed and incorporate things like this into the code. It's a bit much for one PR, so I have postponed properly checking it for forever. I hope in a few weeks from now I have more time for this project here again and will be able to get this code base and everything around it more polished into something that can be downloaded and used.
I am also working on similar changes using cargo clippy
but I for now am trying not to touch main.rs
as I believe there should be a bigger refactor on execution flow and maybe replace some variable declarations. Good examples would be:
String
in favor of Box<str>
as the former is a struct that is approximately usize * 3
(pointer + current length + capacity) and the latter is just a fat pointer (pointer + len). Also after initial command line read, the variables are no longer mutated so we don't methods for extending the allocation.O(n)
where n
is equal to password length.
While debugging a problem (which turns out to be caused by my password manager) I just started to refactor the code to make it easier to read and understand. The main changes are:
Stack
bystd::vec::Vec
Not sure if you want any of those changes. In case you only want some of them I can also revert the others.