How do I fix mismatching dependencies in my Cargo file to work around native library collisions?

前端 未结 1 1112
猫巷女王i
猫巷女王i 2021-01-21 17:31

I\'m setting up a Rust server with Rocket and I\'m trying to use it with a JWT library. They use different versions of the *ring* crate and I get an error during cargo bui

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-21 17:31

    You have to fix this by not transitively depending on different versions of crates that link to a native library.

    There's no newer version of rocket available that depends on version 0.10 of cookie, which depends on ring 0.12, so you'll need to downgrade jsonwebtoken to 2.0.3.

    You can work this out by checking the crates.io pages for the crates in question (like with jsonwebtoken), going back through older versions, and looking to see what dependencies it needs.

    0 讨论(0)
提交回复
热议问题