I am currently working on University project in Rust. Goal is to build a game with GUI. Therefore I am trying to implement simple board game using fltk library. I've created struct called Grid to memorize board state using 2d vector matrix, inside implementation I have method called test1() that I need to run on button pressed.
Here You can see calling part that does not work.
Note that line 110 executes without a problem, while line 109 gives an error. (make_move() is void function that just prints out a number)
Error that I am getting is the following:
error[E0373]: closure may outlive the current function, but it borrows grid
, which is owned by the current function
I've tried googling given error and all of the availiable solutions give me more errors. Most of them due to not being able to implement Copy trait as I am using Vectors inside of struct.