I have installed git, gtk3-rs, and “visual studio code” as an working environment, and had some success in building on the examples. I installed crate “canrust” to play with a canvas and when I tried to set-up a provided example the file “mod.rs” compilation generated the below result:
> Executing task: cargo run --package gtk-rs-examples --bin canvastests <
Compiling canrust v1.3.3
error[E0412]: cannot find type `NoneError` in module `std::option`
--> /home/greg/.cargo/registry/src/github.com-1ecc6299db9ec823/canrust-1.3.3/src/utils/mod.rs:169:28
|
169 | NoneError(std::option::NoneError),
| ^^^^^^^^^ not found in `std::option`
|
help: there is an enum variant `crate::utils::Error::NoneError`; try using the variant's enum
|
169 | NoneError(crate::utils::Error),
| ~~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `NoneError` in module `std::option`
--> /home/greg/.cargo/registry/src/github.com-1ecc6299db9ec823/canrust-1.3.3/src/utils/mod.rs:190:24
|
190 | impl From<std::option::NoneError> for Error {
| ^^^^^^^^^ not found in `std::option`
|
help: there is an enum variant `crate::utils::Error::NoneError`; try using the variant's enum
|
190 | impl From<crate::utils::Error> for Error {
| ~~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `NoneError` in module `std::option`
--> /home/greg/.cargo/registry/src/github.com-1ecc6299db9ec823/canrust-1.3.3/src/utils/mod.rs:191:33
|
191 | fn from(error: std::option::NoneError) -> Self {
| ^^^^^^^^^ not found in `std::option`
|
help: there is an enum variant `crate::utils::Error::NoneError`; try using the variant's enum
|
191 | fn from(error: crate::utils::Error) -> Self {
| ~~~~~~~~~~~~~~~~~~~
For more information about this error, try `rustc --explain E0412`.
error: could not compile `canrust` due to 3 previous errors
The terminal process "cargo 'run', '--package', 'gtk-rs-examples', '--bin', 'canvastests'" terminated with exit code: 101.
this is “Main.rs”
use canrust::canvas::{Canvas, Color};
use crate::utils::Error
fn main() { // Create a canvas:
// size, name, background color
let mut canvas = Canvas::new((800, 600), "Canvas", Color::WHITE);
// create shapes:
canvas.create_circle((1., 1.), 20., Color::BLACK, None, None);
canvas.create_rectangle((20., 20.), (30., 80.), Color::BLACK, None, None);
canvas.create_line((18., 20.), (18., 80.), 2., Color::RED, None, None);
canvas.create_line((32., 20.), (32. 80.), 2., Color::RED, None, None);
// call mainloop, objects will be rendered as long as the program is running
canvas.mainloop()
}
could someone tell me what I am doing wrong??
Thanks in advance