Solved! Could not compile `urlencoded`


have an issue compiling the urlencoded package,
opend an issue on GitHub after i had no search result, but until now get no response.

iron = "0.2.2"
mime = "0.1.0"
router = "0.0.15"
urlencoded = “0.2.0”

As someone new to Rust it is hard to debug my own code rather than library code…
but i could locate the error in
the trait plugin::Plugin<iron::request::Request<'_, '_>> is not implemented for the type bodyparser::Raw [E0277]at line 98 col 13

Here is a print of the build.

> $ cargo build                                                                                       
   Compiling urlencoded v0.2.1
: 98:16 error: the trait `plugin::Plugin<iron::request::Request<'_, '_>>` is not implemented for the type `bodyparser::Raw`


: 98:16 help: run `rustc --explain E0277` to see a detailed explanation
: 98:16 help: the following implementations were found:
: 98:16 help:   <bodyparser::Raw as plugin::Plugin<iron::request::Request<'a, 'b>>>
error: aborting due to previous error
Could not compile `urlencoded`.

> $ cargo --version                                                                                   
cargo 0.9.0-nightly (8fc3fd8 2016-02-29)

rustc --version                                                                                    
rustc 1.8.0 (db2939409 2016-04-11)

thanks in advance regards


It looks like urlencoded v0.2.1 had an incorrect Cargo.toml, so it ends up using the wrong version of the bodyparser crate. It looks like this issue is solved in urlencoded v0.3. If you’re stuck using v0.2.1 for whatever reason, you might be able to work around the issue by messing with your Cargo.lock file to force the correct version of bodyparser.


Thanks @eefriedman
i tried before
iron = ""
mime = "
router = “"
urlencoded = "

cargo build
but nothing updated in Cargo.lock, so i thought it were the last releases…

but after your hint i removed
Cargo.lock file and
$ cargo run

now it works fine!
Thanks a lot!