diff --git a/packages/yew-macro/src/html_tree/html_node.rs b/packages/yew-macro/src/html_tree/html_node.rs index 31ad2e7f938..06be31ccc46 100644 --- a/packages/yew-macro/src/html_tree/html_node.rs +++ b/packages/yew-macro/src/html_tree/html_node.rs @@ -22,7 +22,8 @@ impl Parse for HtmlNode { Lit::ByteStr(lit) => { return Err(syn::Error::new( lit.span(), - "byte-strings can't be converted to HTML text\nnote: remove the `b` prefix", + "byte-strings can't be converted to HTML text + note: remove the `b` prefix or convert this to a `String`", )) } Lit::Verbatim(lit) => { diff --git a/packages/yew-macro/src/stringify.rs b/packages/yew-macro/src/stringify.rs index df99398e92e..75764266841 100644 --- a/packages/yew-macro/src/stringify.rs +++ b/packages/yew-macro/src/stringify.rs @@ -88,9 +88,8 @@ impl Stringify for Lit { Lit::Int(v) => v.base10_digits().into(), Lit::Float(v) => v.base10_digits().into(), Lit::Bool(v) => if v.value() { "true" } else { "false" }.into(), - Lit::ByteStr(v) => String::from_utf8(v.value()).ok()?.into(), Lit::Byte(v) => v.value().to_string().into(), - Lit::Verbatim(v) => v.to_string().into(), + Lit::Verbatim(_) | Lit::ByteStr(_) => return None, _ => unreachable!("unknown Lit {:?}", self), }; Some(LitStr::new(&s, self.span()))