Was this translated automatically from C? I picked a spot totally at random and saw in https://github.com/Ragnaroek/iron-wolf/blob/main/src/act1.rs in place_item_type:
let mut found_info = None;
for info in &STAT_INFO {
if info.kind == item_type {
found_info = Some(info);
break;
}
}
When typically in rust this is just: let found_info = STAT_INFO.iter().find(|info| info.kind() == item_type);
Now I want to go through and feng shui all the code to look more like idiomatic rust just to waste some time on a saturday...
As a non-Rust guy, I keep writing the example above. I didn't even know about the second option!
If you do that, please share a link so I can learn from you! This is awesome!
Yes, the code is _very, very_ close to the C-Code. All over the place.
Sounds like something an LLM agent might be good at?