Skip to content

Commit

Permalink
fix tests/example
Browse files Browse the repository at this point in the history
  • Loading branch information
ranile committed Aug 25, 2021
1 parent e9f847d commit 11e105f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions examples/router/src/pages/post.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::{content, generator::Generated, Route};
use content::PostPart;
use std::borrow::Cow;
use yew::prelude::*;
use yew_router::prelude::*;

Expand Down Expand Up @@ -39,7 +38,7 @@ impl Component for Post {
html! {
<>
<section class="hero is-medium is-light has-background">
<img class="hero-background is-transparent" src={Cow::Owned(post.meta.image_url.clone())} />
<img class="hero-background is-transparent" src={post.meta.image_url.clone()} />
<div class="hero-body">
<div class="container">
<h1 class="title">
Expand Down Expand Up @@ -70,7 +69,7 @@ impl Post {
<article class="media block box my-6">
<figure class="media-left">
<p class="image is-64x64">
<img src={Cow::Owned(quote.author.image_url.clone())} loading="lazy" />
<img src={quote.author.image_url.clone()} loading="lazy" />
</p>
</figure>
<div class="media-content">
Expand All @@ -90,7 +89,7 @@ impl Post {
fn render_section_hero(&self, section: &content::Section) -> Html {
html! {
<section class="hero is-dark has-background mt-6 mb-3">
<img class="hero-background is-transparent" src={Cow::Owned(section.image_url.clone())} loading="lazy" />
<img class="hero-background is-transparent" src={section.image_url.clone()} loading="lazy" />
<div class="hero-body">
<div class="container">
<h2 class="subtitle">{ &section.title }</h2>
Expand Down
4 changes: 2 additions & 2 deletions packages/yew/src/html/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod test {
fn test_str() {
let _: String = "foo".into_prop_value();
let _: Option<String> = "foo".into_prop_value();
let _: Cow<'static, str> = "foo".into_prop_value();
let _: Option<Cow<'static, str>> = "foo".into_prop_value();
let _: AttrValue = "foo".into_prop_value();
let _: Option<AttrValue> = "foo".into_prop_value();
}
}
2 changes: 1 addition & 1 deletion packages/yew/src/virtual_dom/vtag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ mod tests {
<@{"input"} value="World"/>
};
let input_vtag = assert_vtag_mut(&mut input_el);
assert_eq!(input_vtag.value(), Some(&Cow::Borrowed("World")));
assert_eq!(input_vtag.value(), Some(&AttrValue::Static("World")));
assert!(!input_vtag.attributes.iter().any(|(k, _)| k == "value"));
}

Expand Down

0 comments on commit 11e105f

Please sign in to comment.