I'm trying to learn Rust, and am writing my standard Tetrii (multi-board tetris) program. I've run into some problems, and am hoping someone can either point out a memory technique I don't know, or (ugh) tell me that the overall design is not suited to Rust.
The code is on github, at https://github.com/russellyoung/tetrii . There are 2 branches. The branch "no-controller" works, it pops up 1 - 5 boards which can be played with either mouse or keyboard commands. This version uses a static Vec<Rc<RefCell< Board>>> value to store the Board structs, and I (think I) know this is frowned on.
The main branch has a new struct, Controller, which is to be another window with buttons to start and stop, select the number of boards, report scores, and so on. It is also intended to hold the memory items that are needed, again wrapped as necessary. Unfortunately, however I set it up, when I try starting up the game boards I get an "already borrowed" error. I think I see where it is coming from, though I had thought that using the RefCells would get me past that. The program does not use threads, but callbacks that need to write apparently are being called when other copies are still borrowed.
The code isn't that long but I'm not asking for a full review (though I'd welcome as much as is offered), but the big question is whether this design is suitable for Rust, or whether I'm bringing habits from other languages into play where they aren't appropriate.
Thanks for any comments, as a Rust newbie without access to anyone who knows about it getting this far has been a slog, and I'm hoping this is not the dead end it appears to be