Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo install broken on latest release #22

Closed
mrpatrickpilch opened this issue Feb 9, 2023 · 1 comment · Fixed by #23
Closed

cargo install broken on latest release #22

mrpatrickpilch opened this issue Feb 9, 2023 · 1 comment · Fixed by #23

Comments

@mrpatrickpilch
Copy link

rustc & cargo version is 1.65.0

$ cargo install mdbook-d2
....
   Compiling toml v0.5.11
   Compiling mdbook-d2 v0.2.0
error[E0277]: the trait bound `Value: From<toml::map::Map<std::string::String, toml::value::Value>>` is not satisfied
  --> /Users/patrickpilch/.cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-d2-0.2.0/src/backend.rs:69:34
   |
69 |         let value: toml::Value = ctx.config.get_preprocessor("d2").unwrap().clone().into();
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- required by a bound introduced by this call
   |                                  |
   |                                  the trait `From<toml::map::Map<std::string::String, toml::value::Value>>` is not implemented for `Value`
   |
   = help: the following other types implement trait `From<T>`:
             <Value as From<&'a str>>
             <Value as From<BTreeMap<S, V>>>
             <Value as From<HashMap<S, V>>>
             <Value as From<Vec<V>>>
             <Value as From<bool>>
             <Value as From<f32>>
             <Value as From<f64>>
             <Value as From<i32>>
           and 7 others
   = note: required for `toml::map::Map<std::string::String, toml::value::Value>` to implement `Into<Value>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `mdbook-d2` due to previous error
warning: build failed, waiting for other jobs to finish...
@danieleades
Copy link
Owner

MdBook has just made a breaking change with a patch semver bump...
I should know, i submitted the PR - rust-lang/mdBook#2009

this plugin and mdbook are therefore using conflicting versions of the toml library.

you can use the tested version by having cargo install respect the lockfile committed in this repo-

cargo install mdbook-d2 --locked

(it's not a bad rule of thumb to use that for most binaries)

I'll also get a patch out to bump the toml dependency in this plugin to match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants