amethyst / amethyst/rustrogueliketutorial

Chapter 7: ConvertSaveload requires serde as a dependency.

Đang mở
#214 1 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
970
Fork
166
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

While following along with chapter 7, I encountered a bunch of errors related to the use of the derive macro `ConvertSaveload` on the `WantsToMelee` component.

Further, nowhere in the tutorial does it explain that this will require serde as a dependency. I had to add the following to my cargo.toml:

```toml
[dependencies]
rltk = { git = "https://github.com/amethyst/bracket-lib" }
specs = { version = "0.17", features = ["serde"] } # added features = "serde"
serde = "1.0" # added serde dependency
```

Using the git version of rltk as per amethyst/bracket-lib#301
I also had to manually add the following additional imports:

```rust
use specs::saveload::{ConvertSaveload, Marker};
use specs::error::NoError;
use serde::{Serialize, Deserialize};
```

Failing to do so results in a series of complaints that various traits cannot be found. I'm still pretty new to rust, but I get the feeling that I shouldn't need to manually bring all of these traits into scope. I assume that this is the result of something not quite working right on the side of specs or specs-derive.

My suggestion would be to either remove the use of ConvertSaveload, or add clear instructions detailing the additional changes necessary to compile from that point on.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.