Fix issues after cherry-picking

This commit is contained in:
Hamza 2021-06-06 00:02:11 +05:00 committed by Simon
parent e1f093858b
commit 8fc81b47ee
7 changed files with 12 additions and 14 deletions

View File

@ -1,5 +1,6 @@
use crate::{content, generator::Generated, Route}; use crate::{content, generator::Generated, Route};
use content::PostPart; use content::PostPart;
use std::borrow::Cow;
use yew::prelude::*; use yew::prelude::*;
use yew_router::prelude::*; use yew_router::prelude::*;
@ -46,7 +47,7 @@ impl Component for Post {
html! { html! {
<> <>
<section class="hero is-medium is-light has-background"> <section class="hero is-medium is-light has-background">
<img class="hero-background is-transparent" src=post.meta.image_url /> <img class="hero-background is-transparent" src=Cow::Owned(post.meta.image_url.clone()) />
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">
<h1 class="title"> <h1 class="title">
@ -77,7 +78,7 @@ impl Post {
<article class="media block box my-6"> <article class="media block box my-6">
<figure class="media-left"> <figure class="media-left">
<p class="image is-64x64"> <p class="image is-64x64">
<img src=quote.author.image_url loading="lazy" /> <img src=Cow::Owned(quote.author.image_url.clone()) loading="lazy" />
</p> </p>
</figure> </figure>
<div class="media-content"> <div class="media-content">
@ -97,7 +98,7 @@ impl Post {
fn render_section_hero(&self, section: &content::Section) -> Html { fn render_section_hero(&self, section: &content::Section) -> Html {
html! { html! {
<section class="hero is-dark has-background mt-6 mb-3"> <section class="hero is-dark has-background mt-6 mb-3">
<img class="hero-background is-transparent" src=section.image_url loading="lazy" /> <img class="hero-background is-transparent" src=Cow::Owned(section.image_url.clone()) loading="lazy" />
<div class="hero-body"> <div class="hero-body">
<div class="container"> <div class="container">
<h2 class="subtitle">{ &section.title }</h2> <h2 class="subtitle">{ &section.title }</h2>

View File

@ -34,9 +34,9 @@ error[E0277]: `()` doesn't implement `std::fmt::Display`
15 | <>{ for (0..3).map(|_| not_tree()) }</> 15 | <>{ for (0..3).map(|_| not_tree()) }</>
| ^^^^^^ `()` cannot be formatted with the default formatter | ^^^^^^ `()` cannot be formatted with the default formatter
| |
::: $WORKSPACE/packages/yew/src/utils.rs:76:8 ::: $WORKSPACE/packages/yew/src/utils.rs
| |
76 | T: Into<R>, | T: Into<R>,
| ------- required by this bound in `into_node_iter` | ------- required by this bound in `into_node_iter`
| |
= help: the trait `std::fmt::Display` is not implemented for `()` = help: the trait `std::fmt::Display` is not implemented for `()`

View File

@ -70,9 +70,9 @@ error[E0277]: `()` is not an iterator
18 | { for () } 18 | { for () }
| ^^ `()` is not an iterator | ^^ `()` is not an iterator
| |
::: $WORKSPACE/packages/yew/src/utils.rs:75:9 ::: $WORKSPACE/packages/yew/src/utils.rs
| |
75 | IT: IntoIterator<Item = T>, | IT: IntoIterator<Item = T>,
| ---------------------- required by this bound in `into_node_iter` | ---------------------- required by this bound in `into_node_iter`
| |
= help: the trait `Iterator` is not implemented for `()` = help: the trait `Iterator` is not implemented for `()`

View File

@ -1,6 +1,6 @@
[package] [package]
name = "yew-router-macro" name = "yew-router-macro"
version = "0.14.0" version = "0.15.0"
authors = ["Hamza <muhammadhamza1311@gmail.com>"] authors = ["Hamza <muhammadhamza1311@gmail.com>"]
edition = "2018" edition = "2018"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "yew-router" name = "yew-router"
version = "0.14.0" version = "0.15.0"
authors = ["Hamza <muhammadhamza1311@gmail.com>"] authors = ["Hamza <muhammadhamza1311@gmail.com>"]
edition = "2018" edition = "2018"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"

View File

@ -61,7 +61,7 @@ fn component() -> Html {
<a onclick=onclick>{"click me"}</a> <a onclick=onclick>{"click me"}</a>
</> </>
}, },
Routes::No { id } => html! { <No id=id /> }, Routes::No { id } => html! { <No id=*id /> },
Routes::NotFound => html! { <div id="result">{"404"}</div> }, Routes::NotFound => html! { <div id="result">{"404"}</div> },
} }
}); });

View File

@ -30,7 +30,7 @@ slab = "0.4"
thiserror = "1" thiserror = "1"
wasm-bindgen = "0.2.74" wasm-bindgen = "0.2.74"
wasm-bindgen-futures = "0.4" wasm-bindgen-futures = "0.4"
yew-macro = { version = "0.17.0", path = "../yew-macro" } yew-macro = { version = "^0.18.0", path = "../yew-macro" }
# optional encodings # optional encodings
bincode = { version = "1", optional = true } bincode = { version = "1", optional = true }
@ -38,9 +38,6 @@ rmp-serde = { version = "0.15.0", optional = true }
serde_cbor = { version = "0.11.1", optional = true } serde_cbor = { version = "0.11.1", optional = true }
serde_yaml = { version = "0.8.4", optional = true } serde_yaml = { version = "0.8.4", optional = true }
toml = { version = "0.5", optional = true } toml = { version = "0.5", optional = true }
wasm-bindgen = { version = "0.2.60", optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
yew-macro = { version = "^0.18.0", path = "../yew-macro" }
[dependencies.web-sys] [dependencies.web-sys]
version = "0.3" version = "0.3"