When I follow the commands in the readme with rustc 1.47.0 compliation fails with the following errors (warnings omitted):
error[E0596]: cannot borrow `res` as mutable, as it is a captured variable in a `Fn` closure
--> src/grid.rs:123:17
|
123 | res.cursor_set_index(i);
| ^^^ cannot borrow as mutable
error[E0505]: cannot move out of `res` because it is borrowed
--> src/grid.rs:122:47
|
121 | for (i, widget) in res.buttons.iter().enumerate() {
| ----------- borrow of `res.buttons` occurs here
122 | widget.connect_enter_notify_event(move |widget, _| {
| ^^^^^^^^^^^^^^^^ move out of `res` occurs here
123 | res.cursor_set_index(i);
| --- move occurs due to use in closure
error[E0382]: use of moved value: `res`
--> src/grid.rs:122:47
|
112 | let mut res = Self {
| ------- move occurs because `res` has type `grid::Grid`, which does not implement the `Copy` trait
...
122 | widget.connect_enter_notify_event(move |widget, _| {
| ^^^^^^^^^^^^^^^^ value used here after move
123 | res.cursor_set_index(i);
| --- use occurs due to use in closure
...
127 | widget.connect_leave_notify_event(move |widget, _| {
| ---------------- value moved into closure here, in previous iteration of loop
error[E0505]: cannot move out of `res` because it is borrowed
--> src/grid.rs:127:47
|
121 | for (i, widget) in res.buttons.iter().enumerate() {
| ----------- borrow of `res.buttons` occurs here
...
127 | widget.connect_leave_notify_event(move |widget, _| {
| ^^^^^^^^^^^^^^^^ move out of `res` occurs here
128 | res.cursor_hide();
| --- move occurs due to use in closure
error[E0382]: use of moved value: `res`
--> src/grid.rs:127:47
|
112 | let mut res = Self {
| ------- move occurs because `res` has type `grid::Grid`, which does not implement the `Copy` trait
...
122 | widget.connect_enter_notify_event(move |widget, _| {
| ---------------- value moved into closure here
123 | res.cursor_set_index(i);
| --- variable moved due to use in closure
...
127 | widget.connect_leave_notify_event(move |widget, _| {
| ^^^^^^^^^^^^^^^^ value used here after move
128 | res.cursor_hide();
| --- use occurs due to use in closure
... Which is unfortunate because it looks really cool :/