hypo 0.1.0

tiny crate that renders html through macros
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use hypo::Element;

#[test]
fn element() {
    let mut s = String::new();

    let mut el = Element::<false>::open(&mut s, "div");
    assert_eq!(&el as &str, "<div");

    el.push('>');
    assert_eq!(&el as &str, "<div>");

    Element::<true>::open(&mut el, "br").push('>');
    assert_eq!(&el as &str, "<div><br>");

    drop(el);
    assert_eq!(s, "<div><br></div>");
}