From 98b97b7efc56433c9662647b43e0bf2e372aa06f Mon Sep 17 00:00:00 2001 From: OgGhostJelly Date: Fri, 14 Mar 2025 10:19:04 +0700 Subject: [PATCH 1/2] fix: VDomGuard::get_mut_ref not returning a mutable ref --- src/vdom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vdom.rs b/src/vdom.rs index 5a98a6c..ab31f22 100644 --- a/src/vdom.rs +++ b/src/vdom.rs @@ -232,7 +232,7 @@ impl VDomGuard { /// Returns a mutable reference to the inner DOM. /// /// The lifetime of the returned `VDom` is bound to self so that elements cannot outlive this `VDomGuard` struct. - pub fn get_mut_ref<'a, 'b: 'a>(&'b mut self) -> &'b VDom<'a> { + pub fn get_mut_ref<'a, 'b: 'a>(&'b mut self) -> &'b mut VDom<'a> { &mut self.dom } } From b243f8e35fe8cbc26326bdc8a6c4847720493e75 Mon Sep 17 00:00:00 2001 From: OgGhostJelly Date: Fri, 14 Mar 2025 11:43:51 +0700 Subject: [PATCH 2/2] fix: invalid lifetimes caused by previous commit --- src/vdom.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vdom.rs b/src/vdom.rs index ab31f22..3666987 100644 --- a/src/vdom.rs +++ b/src/vdom.rs @@ -232,7 +232,8 @@ impl VDomGuard { /// Returns a mutable reference to the inner DOM. /// /// The lifetime of the returned `VDom` is bound to self so that elements cannot outlive this `VDomGuard` struct. - pub fn get_mut_ref<'a, 'b: 'a>(&'b mut self) -> &'b mut VDom<'a> { + pub fn get_mut_ref(&mut self) -> &mut VDom<'static> + { &mut self.dom } }