The code in the examples/ directory is unable to compile due to a mismatch between the dependencies specified in the Cargo.toml file and the versions of the dependencies used in the example code.
Steps to Reproduce
Review the Cargo.toml file, which shows the following dependency versions:
Run the example code located in the examples/ directory.
Observe the following error message:
(This is the case for examples/simple.rs)
error[E0308]: mismatched types
--> src/main.rs:36:41
|
36 | let root = EguiBackend::new(ui).into_drawing_area();
| ---------------- ^^ expected `&Ui`, found `&mut Ui`
| |
| arguments to this function are incorrect
|
= note: `Ui` and `egui::ui::Ui` have similar names, but are actually distinct types
note: `Ui` is defined in crate `egui`
--> /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.25.0/src/ui.rs:31:1
|
31 | pub struct Ui {
| ^^^^^^^^^^^^^
note: `egui::ui::Ui` is defined in crate `egui`
--> /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-0.22.0/src/ui.rs:31:1
|
31 | pub struct Ui {
| ^^^^^^^^^^^^^
= note: perhaps two different versions of crate `egui` are being used?
note: associated function defined here
--> /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/egui-plotter-0.3.0/src/backend.rs:200:12
|
200 | pub fn new(ui: &'a Ui) -> Self {
| ^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `metaheuristics` (bin "metaheuristics") due to 1 previous error
Expected Behavior
The example code should compile and run without any issues, using the dependency versions specified in the Cargo.toml file.
Actual Behavior
The example code fails to compile due to a mismatch between the dependency versions used in the code and the versions specified in the Cargo.toml file.
Proposed Solution
Update the Cargo.toml file to use the same versions of the egui and eframe dependencies as the example code:
Description
The code in the examples/ directory is unable to compile due to a mismatch between the dependencies specified in the Cargo.toml file and the versions of the dependencies used in the example code.
Steps to Reproduce
examples/simple.rs
)Expected Behavior
The example code should compile and run without any issues, using the dependency versions specified in the Cargo.toml file.
Actual Behavior
The example code fails to compile due to a mismatch between the dependency versions used in the code and the versions specified in the Cargo.toml file.
Proposed Solution
This should resolve the compilation issue and allow the example code to run successfully.