Skip to content

Commit ba78970

Browse files
committed
merge master; fix VList PartialEq; extract implicit-clone as workspace dep
1 parent 30dd90e commit ba78970

6 files changed

Lines changed: 17 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ unexpected_cfgs = { level = "warn", check-cfg = [
3030
]}
3131
[workspace.dependencies]
3232
tokio = { version = "1.47.1" }
33+
implicit-clone = { version = "0.5.1" }

examples/immutable/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
implicit-clone = { version = "0.5", features = ["map"] }
9+
implicit-clone = { workspace = true, features = ["map"] }
1010
wasm-bindgen = "0.2"
1111
web-sys = "0.3"
1212
yew = { path = "../../packages/yew", features = ["csr"] }

examples/nested_list/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
license = "MIT OR Apache-2.0"
77

88
[dependencies]
9-
implicit-clone = "0.4"
9+
implicit-clone = { workspace = true }
1010
log = "0.4"
1111
wasm-logger = "0.2"
1212
yew = { path = "../../packages/yew", features = ["csr"] }

packages/yew-macro/tests/html_macro/element-fail.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ error[E0277]: the trait bound `NotToString: IntoPropValue<Option<implicit_clone:
472472
`&'static str` implements `IntoPropValue<Option<implicit_clone::unsync::string::IString>>`
473473
`&'static str` implements `IntoPropValue<String>`
474474
`&'static str` implements `IntoPropValue<implicit_clone::unsync::string::IString>`
475-
`&String` implements `IntoPropValue<VNode>`
475+
`&ChildrenRenderer<VNode>` implements `IntoPropValue<VNode>`
476476
and $N others
477477

478478
error[E0277]: the trait bound `Option<NotToString>: IntoPropValue<Option<implicit_clone::unsync::string::IString>>` is not satisfied
@@ -672,7 +672,7 @@ error[E0277]: the trait bound `NotToString: IntoPropValue<Option<implicit_clone:
672672
`&'static str` implements `IntoPropValue<Option<implicit_clone::unsync::string::IString>>`
673673
`&'static str` implements `IntoPropValue<String>`
674674
`&'static str` implements `IntoPropValue<implicit_clone::unsync::string::IString>`
675-
`&String` implements `IntoPropValue<VNode>`
675+
`&ChildrenRenderer<VNode>` implements `IntoPropValue<VNode>`
676676
and $N others
677677

678678
error[E0277]: the trait bound `(): IntoPropValue<yew::NodeRef>` is not satisfied

packages/yew/src/virtual_dom/vlist.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::ops::{Deref, DerefMut};
33
use std::rc::Rc;
44

55
use super::{Key, VNode};
6-
use crate::html::ImplicitClone;
76

87
#[doc(hidden)]
98
#[derive(Clone, Copy, Debug, PartialEq)]
@@ -27,7 +26,16 @@ pub struct VList {
2726

2827
impl PartialEq for VList {
2928
fn eq(&self, other: &Self) -> bool {
30-
self.key == other.key && self.children == other.children
29+
if self.key != other.key {
30+
return false;
31+
}
32+
33+
match (self.children.as_ref(), other.children.as_ref()) {
34+
(Some(a), Some(b)) => a == b,
35+
(Some(a), None) => a.is_empty(),
36+
(None, Some(b)) => b.is_empty(),
37+
(None, None) => true,
38+
}
3139
}
3240
}
3341

0 commit comments

Comments
 (0)