3 ms·
> don't "convert" PHP code into Rust. Re-design your program. Trust me, I am! For example, I'm rewriting all the (very-efficient) PHP regex code to a much mor
by muglug 5y ago
> don't "convert" PHP code into Rust. Re-design your program.
Trust me, I am!
For example, I'm rewriting all the (very-efficient) PHP regex code to a much more convoluted version because Regex::new is so costly.
Less sarcastically, I am embracing the Rust Way where necessary. My complaint is that the Rust Way sometimes forces me to depart from the idealised pseudocode version of a given algorithm much more drastically than PHP does.
- Gwypaas 5y agoAny reason why you can't put the Regex in a once_cell and then keep on applying it?
- mustache_kimono 5y agoWait... You're rewriting the PHP regex code instead of using the regex crate?! Just...wait...why? Are you using lazy_static? See: https://docs.rs/regex/latest/regex/#example-avoid-compiling-the-same-regex-in-a-loop https://docs.rs/regex/latest/regex/#example-avoid-compiling-...