Replaced .with(Clone::clone) with .get_cloned().

This commit is contained in:
Filipe Rodrigues 2024-02-20 14:19:55 +00:00
parent 43f9d3bd88
commit e775a5bf7a
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
// Imports
use {
crate::Location,
dynatos_reactive::{Effect, Signal, SignalReplace, SignalSet, SignalUpdate, SignalWith},
dynatos_reactive::{Effect, Signal, SignalGetCloned, SignalReplace, SignalSet, SignalUpdate, SignalWith},
std::{collections::HashMap, error::Error as StdError, mem, rc::Rc, str::FromStr},
};
@ -38,7 +38,7 @@ impl<T> QuerySignal<T> {
let key = Rc::clone(&key);
move || {
// Get the location and find our query key, if any
let location = dynatos_context::with_expect::<Location, _, _>(|location| location.with(Clone::clone));
let location = dynatos_context::with_expect::<Location, _, _>(|location| location.get_cloned());
let value = location
.query_pairs()
.find_map(|(query, value)| (query == *key).then_some(value))

View File

@ -7,7 +7,7 @@
use {
dynatos::{NodeWithDynChild, ObjectWithContext},
dynatos_html::{html, NodeWithChildren, NodeWithText},
dynatos_reactive::SignalWith,
dynatos_reactive::SignalGetCloned,
dynatos_router::Location,
std::cell::LazyCell,
tracing_subscriber::prelude::*,
@ -61,7 +61,7 @@ thread_local! {
}
fn render_route() -> Option<Element> {
let location = dynatos_context::with_expect::<Location, _, _>(|location| location.with(Clone::clone));
let location = dynatos_context::with_expect::<Location, _, _>(|location| location.get_cloned());
tracing::info!(%location, "Rendering route");
match location.path().trim_end_matches('/') {