parent
9fc96ea5c3
commit
f046b64409
3 changed files with 22 additions and 2 deletions
|
@ -1,5 +1,10 @@
|
|||
# Change Log
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- [Fixed] "Multiple applicable items in scope" error when using `Render` trait
|
||||
[#97](https://github.com/lfairy/maud/issues/97)
|
||||
|
||||
## [0.17.0] - 2017-08-04
|
||||
|
||||
- [Added] Allow terminating void elements with semicolons (`;`)
|
||||
|
|
|
@ -67,3 +67,18 @@ fn render_impl() {
|
|||
assert_eq!(s1, "pinkie");
|
||||
assert_eq!(s2, "pinkie");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_97() {
|
||||
use maud::Render;
|
||||
|
||||
struct Pinkie;
|
||||
impl Render for Pinkie {
|
||||
fn render(&self) -> maud::Markup {
|
||||
let x = 42;
|
||||
html! { (x) }
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(html!((Pinkie)).into_string(), "42");
|
||||
}
|
||||
|
|
|
@ -84,12 +84,12 @@ impl Renderer {
|
|||
extern crate maud;
|
||||
// Create a local trait alias so that autoref works
|
||||
trait Render: maud::Render {
|
||||
fn render_to(&self, output: &mut String) {
|
||||
fn __maud_render_to(&self, output: &mut String) {
|
||||
maud::Render::render_to(self, output);
|
||||
}
|
||||
}
|
||||
impl<T: maud::Render> Render for T {}
|
||||
$expr.render_to(&mut $output);
|
||||
$expr.__maud_render_to(&mut $output);
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue