FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.61k stars 340 forks source link

Latest commit breaks cargo install command #428

Closed berylliumquestion closed 1 year ago

berylliumquestion commented 1 year ago

This commit https://github.com/FyroxEngine/Fyrox/commit/d18548fde67b80a396e2130f884eddd77de4f242

causes this to happen when I run: cargo install fyrox-template --force --git https://github.com/FyroxEngine/Fyrox


error[E0382]: borrow of moved value: `script_file_stem`
   --> template/src/main.rs:531:29
    |
463 |     let script_file_stem = raw_name.to_case(Case::Snake);
    |         ---------------- move occurs because `script_file_stem` has type `std::string::String`, which does not implement the `Copy` trait
464 |     let script_name = raw_name.to_case(Case::UpperCamel);
465 |     let file_name = base_path.join(script_file_stem + ".rs");
    |                                    ------------------------ `script_file_stem` moved due to usage in operator
...
531 |         adding:\n\tpub mod {script_file_stem};\nat either lib.rs or som...
    |                             ^^^^^^^^^^^^^^^^ value borrowed here after move
    |
note: calling this operator moves the left-hand side
   --> /rustc/585f3eef26f04440bca726c29193af7b4fa90e54/library/core/src/ops/arith.rs:92:12
    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider cloning the value if the performance cost is acceptable
    |
465 |     let file_name = base_path.join(script_file_stem.clone() + ".rs");
    |                                                    ++++++++

For more information about this error, try `rustc --explain E0382`.
error: could not compile `fyrox-template` due to previous error
error: failed to compile `fyrox-template v0.6.1 (https://github.com/FyroxEngine/Fyrox?rev=d18548fde67b80a396e2130f884eddd77de4f242#d18548fd)`, intermediate artifacts can be found at `/tmp/cargo-installwTTsWF`
mrDIMAS commented 1 year ago

Should be fixed now. I did the breaking commit without compilation checks and... yeah shouldn't do that 😅

berylliumquestion commented 1 year ago

Yep, it works now :)