Remove need to enable feature(try_from).
This commit is contained in:
parent
276ba31432
commit
5a72616f97
|
@ -1,4 +1,4 @@
|
|||
#![feature(proc_macro_hygiene, decl_macro, try_from)]
|
||||
#![feature(proc_macro_hygiene, decl_macro)]
|
||||
|
||||
extern crate rocket;
|
||||
extern crate typed_html;
|
||||
|
@ -33,7 +33,7 @@ fn index() -> Html {
|
|||
</head>
|
||||
<body>
|
||||
<h1 data-lol="omg">"Hello Kitty!"</h1>
|
||||
<p class="official-position-of-sanrio-ltd">
|
||||
<p class="official-position-of-sanrio-ltd emphasis">
|
||||
"She is not a "<em><a href="https://en.wikipedia.org/wiki/Cat">"cat"</a></em>". She is a "<em>"human girl"</em>"."
|
||||
</p>
|
||||
<p class=["urgent", "question"]>"But how does she eat?"</p>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(try_from)]
|
||||
#![feature(proc_macro_hygiene)]
|
||||
|
||||
extern crate stdweb;
|
||||
|
|
|
@ -174,7 +174,7 @@ impl Element {
|
|||
value => {
|
||||
let value = process_value(value);
|
||||
body.extend(quote!(
|
||||
element.attrs.$key = Some(std::convert::TryInto::try_into($value).unwrap());
|
||||
element.attrs.$key = Some(std::convert::Into::into($value));
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -212,6 +212,7 @@ impl Element {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME report a decent error when the macro contains multiple top level elements
|
||||
pub fn expand_html(input: &[Token]) -> Result<Node, ParseError> {
|
||||
grammar::NodeParser::new().parse(Lexer::new(input))
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(try_from)]
|
||||
#![feature(proc_macro_hygiene)]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::convert::TryFrom;
|
||||
use std::fmt::{Display, Error, Formatter};
|
||||
use std::ops::Deref;
|
||||
use std::str::FromStr;
|
||||
|
@ -64,20 +63,6 @@ impl FromStr for Class {
|
|||
}
|
||||
}
|
||||
|
||||
impl TryFrom<String> for Class {
|
||||
type Error = &'static str;
|
||||
fn try_from(s: String) -> Result<Self, Self::Error> {
|
||||
Self::try_new(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a str> for Class {
|
||||
type Error = &'static str;
|
||||
fn try_from(s: &'a str) -> Result<Self, Self::Error> {
|
||||
Self::try_new(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Id> for Class {
|
||||
fn from(id: Id) -> Self {
|
||||
Class(id.to_string())
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::convert::TryFrom;
|
||||
use std::fmt::{Display, Error, Formatter};
|
||||
use std::ops::Deref;
|
||||
use std::str::FromStr;
|
||||
|
@ -59,20 +58,6 @@ impl FromStr for Id {
|
|||
}
|
||||
}
|
||||
|
||||
impl TryFrom<String> for Id {
|
||||
type Error = &'static str;
|
||||
fn try_from(s: String) -> Result<Self, Self::Error> {
|
||||
Self::try_new(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a str> for Id {
|
||||
type Error = &'static str;
|
||||
fn try_from(s: &'a str) -> Result<Self, Self::Error> {
|
||||
Self::try_new(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Class> for Id {
|
||||
fn from(c: Class) -> Self {
|
||||
Id(c.to_string())
|
||||
|
|
Loading…
Reference in New Issue