Rust algo crate compile error

The stater kit comes with an algo crate for Rust algos. I downloaded the starter kit, and wanted to get a look at what I would be dealing with. I know rust can be a little slow with compiling (release), so I wanted to see how long the debug version would take to compile. So i tried to compile the starter algo that was provided (get that in the cache so future compiling is faster). I ran However, the compiler (cargo/rustc) returns an error (as seen below). The Rust algo crate has been updated approximately a month ago. I’ve seen others using Rust for their algos. I don’t know if they haven’t updated, or if they got theirs to work. I also created an issue on their github ( Any help would be appreciated.

error[E0599]: no function or associated item named info_units found for struct map::MapTileInner in the current scope
–> algo/src/map/
78 | pub struct MapTileInner {
| ----------------------- function or associated item info_units not found for this

281 | } else if Self::info_units(c, map).len() > 0 {
| ^^^^^^^^^^ function or associated item not found in map::MapTileInner

error[E0599]: no method named into_info found for enum units::SpawnableUnitType in the current scope
–> algo/src/map/
377 | unit_type: unit_type.into_info().unwrap(),
| ^^^^^^^^^ method not found in units::SpawnableUnitType
::: algo/src/
143 | pub enum SpawnableUnitType {
| -------------------------- method into_info not found for this

error: aborting due to 2 previous errors

For more information about this error, try rustc --explain E0599.
error: could not compile algo

Will investigate today, thank you

Any updates?

Most of us using rust have been using it since before a set of recent changes to the naming convention. anyplace you see “info” the new term is “mobile” and if you see “firewall” we now use “structure”.

The specific case here can be fixed by changing “Self::info_units” to “Self::mobile_units” and “into_info” to “into_mobile”. There may be more renames you might need to fix like this, but they should be relatively straightforward if you know how the names have changed!

“bits” was also changed to “mp” or mobile points, while “cores” was changed to “sp” or structure points. The names of each of the individual unit types has also changed. You can probably find an older forum post here explaining the changes that were made! Good luck!

Thank you for the information. So what I’m getting from this is that the people using Rust are using the old crate(befor renaming)?

Yeah, basically I have kept my codebase up to date with changes in Terminal manually, since I have modified everything so much anyway. At the end of the day, your code just communicates with the game via JSON, and as long as your code does this correctly, it doesn’t really matter if you use any of the given code, although I am still using that provided code for the serialization.

Last season I entered the competition using python. It’s a great language just SLOW. I’m trying to simulate turns, and Rust is BLAZING fast (C++ speeds). That’s why I wanted to use rust in the first place.

Fixing the typos as I suggested above should make everything work for you, and if not, feel free to post the next error you get and I’ll do my best to suggest what else to change to make it work.

Some of the other players (now and in the past) use a language like Rust or C++ to write their simulator and then make python bindings so their main code is just in python anyway.

1 Like

Sorry, it’s been a pretty busy week, but fixing this in the default starterkit is near the top of my list of fixes. Thanks for helping out in the meantime @acshikh

1 Like

I understand. Life happens. Thus the way of life.

1 Like

@KittyTechno Should be resolved, try pulling the most recent starterkit

1 Like

Yep. It works now. Thank you.

1 Like