tokio-rs / valuable

MIT License
185 stars 19 forks source link

Fix compile errors in examples and docs in valuable crate #95

Closed alexanderkjall closed 2 years ago

alexanderkjall commented 2 years ago

How to reproduce the errors:

$ git clone https://github.com/tokio-rs/valuable.git
Cloning into 'valuable'...
remote: Enumerating objects: 1365, done.
remote: Counting objects: 100% (406/406), done.
remote: Compressing objects: 100% (145/145), done.
remote: Total 1365 (delta 339), reused 262 (delta 259), pack-reused 959
Receiving objects: 100% (1365/1365), 295.04 KiB | 715.00 KiB/s, done.
Resolving deltas: 100% (834/834), done.
$ cd valuable/valuable
$ cargo test

Example error:

error: cannot find derive macro `Valuable` in this scope
 --> valuable/examples/derive.rs:7:10
  |
7 | #[derive(Valuable)]
  |          ^^^^^^^^
  |
note: `Valuable` is imported here, but it is only a trait, without a derive macro
 --> valuable/examples/derive.rs:1:5
  |
1 | use valuable::Valuable;
  |     ^^^^^^^^^^^^^^^^^^

Those are due to that the feature valuable-derive might not have been enabled, and are fixed by adding a #[cfg(not(feature = "valuable-derive",))] around them.

alexanderkjall commented 2 years ago

Realized that this was neither a complete fix nor a good enough one, closing it for now.