mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
chore: new clippy warnings
This commit is contained in:
parent
b356d3cd28
commit
5cacb57283
8 changed files with 11 additions and 11 deletions
|
@ -53,7 +53,7 @@ mod hydrate_only {
|
|||
}
|
||||
});
|
||||
|
||||
pub static IS_HYDRATING: Cell<bool> = Cell::new(true);
|
||||
pub static IS_HYDRATING: Cell<bool> = const { Cell::new(true) };
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
|
@ -133,7 +133,7 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
thread_local!(static ID: RefCell<HydrationKey> = RefCell::new(HydrationKey { outlet: 0, fragment: 0, error: 0, id: 0 }));
|
||||
thread_local!(static ID: RefCell<HydrationKey> = const {RefCell::new(HydrationKey { outlet: 0, fragment: 0, error: 0, id: 0 })});
|
||||
|
||||
/// Control and utility methods for hydration.
|
||||
pub struct HydrationCtx;
|
||||
|
|
|
@ -117,13 +117,13 @@ fn match_primitive() {
|
|||
assert_eq!(prop, r#"{"name": "test", "value": -1}"#);
|
||||
|
||||
// f64
|
||||
let test = 3.14;
|
||||
let test = 3.25;
|
||||
let prop = (&&Match {
|
||||
name: stringify! {test},
|
||||
value: std::cell::Cell::new(Some(&test)),
|
||||
})
|
||||
.spez();
|
||||
assert_eq!(prop, r#"{"name": "test", "value": 3.14}"#);
|
||||
assert_eq!(prop, r#"{"name": "test", "value": 3.25}"#);
|
||||
|
||||
// bool
|
||||
let test = true;
|
||||
|
|
|
@ -26,7 +26,7 @@ cfg_if::cfg_if! {
|
|||
use std::cell::Cell;
|
||||
|
||||
thread_local! {
|
||||
static IS_SPECIAL_ZONE: Cell<bool> = Cell::new(false);
|
||||
static IS_SPECIAL_ZONE: Cell<bool> = const { Cell::new(false) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -332,7 +332,7 @@ impl Default for SharedContext {
|
|||
|
||||
#[cfg(feature = "experimental-islands")]
|
||||
thread_local! {
|
||||
pub static NO_HYDRATE: Cell<bool> = Cell::new(true);
|
||||
pub static NO_HYDRATE: Cell<bool> = const { Cell::new(true) };
|
||||
}
|
||||
|
||||
#[cfg(feature = "experimental-islands")]
|
||||
|
|
|
@ -1518,7 +1518,7 @@ impl<S, T> UnserializableResource for ResourceState<S, T> {
|
|||
}
|
||||
|
||||
thread_local! {
|
||||
static SUPPRESS_RESOURCE_LOAD: Cell<bool> = Cell::new(false);
|
||||
static SUPPRESS_RESOURCE_LOAD: Cell<bool> = const { Cell::new(false) };
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
|
|
@ -242,7 +242,7 @@ impl<T> StoredValue<T> {
|
|||
with_runtime(|runtime| {
|
||||
let n = {
|
||||
let values = runtime.stored_values.borrow();
|
||||
values.get(self.id).map(Rc::clone)
|
||||
values.get(self.id).cloned()
|
||||
};
|
||||
|
||||
if let Some(n) = n {
|
||||
|
|
|
@ -14,7 +14,7 @@ use std::{
|
|||
};
|
||||
|
||||
thread_local! {
|
||||
static ROUTE_ID: Cell<usize> = Cell::new(0);
|
||||
static ROUTE_ID: Cell<usize> = const { Cell::new(0) };
|
||||
}
|
||||
|
||||
/// Represents an HTTP method that can be handled by this route.
|
||||
|
|
|
@ -201,8 +201,8 @@ pub fn AnimatedRoutes(
|
|||
let matches =
|
||||
get_route_matches(router_id, &base, next_route.clone());
|
||||
let same_route = prev_matches
|
||||
.and_then(|p| p.first().as_ref().map(|r| r.route.key.clone()))
|
||||
== matches.first().as_ref().map(|r| r.route.key.clone());
|
||||
.and_then(|p| p.first().map(|r| r.route.key.clone()))
|
||||
== matches.first().map(|r| r.route.key.clone());
|
||||
if same_route {
|
||||
(animation_state, next_route)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue