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

iron integration does not compile #81

Closed
yanns opened this issue Mar 16, 2017 · 8 comments
Closed

iron integration does not compile #81

yanns opened this issue Mar 16, 2017 · 8 comments

Comments

@yanns
Copy link

yanns commented Mar 16, 2017

I followed the instructions found on https://maud.lambda.xyz/web_frameworks.html to integrate with iron.
And this was working until I updated my dependencies.

Now I have the following compilation error:

error[E0277]: the trait bound `maud::PreEscaped<std::string::String>: iron::modifier::Modifier<iron::Response>` is not satisfied
  --> src/main.rs:88:12
   |
88 |         Ok(Response::with((status::Ok, markup)))
   |            ^^^^^^^^^^^^^^ the trait `iron::modifier::Modifier<iron::Response>` is not implemented for `maud::PreEscaped<std::string::String>`
   |
   = help: the following implementations were found:
             <maud::PreEscaped<std::string::String> as iron::modifier::Modifier<iron::response::Response>>
   = note: required because of the requirements on the impl of `iron::modifier::Modifier<iron::Response>` for `(iron::status::StatusCode, maud::PreEscaped<std::string::String>)`
   = note: required by `iron::Response::with`

error: aborting due to previous error

I use hyper v0.10.5

Any hint?

@ernestas-poskus
Copy link
Contributor

show your Cargo.toml

@yanns
Copy link
Author

yanns commented Mar 16, 2017

@ernestas-poskus
Copy link
Contributor

@yanns problem is that maud added support for iron for 0.5.x version if I am not mistaken, anyway this will solve your problem

λ ow master /tmp/zeugnis
$ g diff
diff --git a/Cargo.toml b/Cargo.toml
index b3a9e23..5783b45 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
 authors = ["Yann Simon <[email protected]>"]
 
 [dependencies]
-iron = "0.4.0"
+iron = "0.5.1"
 maud = { version = "*", features = ["iron"] }
 maud_macros = "*"
 

@yanns
Copy link
Author

yanns commented Mar 16, 2017

Thx for the hint!
(I don't know why it was working before..)

@yanns yanns closed this as completed Mar 16, 2017
@ernestas-poskus
Copy link
Contributor

@yanns if documentation is outdated or missing extra step please feel free to update it

@lambda-fairy
Copy link
Owner

@ernestas-poskus is pretty much correct here. Maud depends on Iron 0.5.* only, so if your app uses 0.4 then the compiler will report that they are incompatible.

See also rust-lang/rust#22750 and rust-lang/cargo#2064 and this article.

@yanns
Copy link
Author

yanns commented Mar 17, 2017

I understand all your points.
But I still do not understand why is has worked before.
Maybe previous cargo versions have picked the transitive dependency instead of the one found in cargo.toml.

@yanns
Copy link
Author

yanns commented Mar 17, 2017

I am trying to propose a change for the documentation, but I don't get how gitbook is working... too dumb...

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

No branches or pull requests

3 participants