Added a blanket restriction lint.

This commit is contained in:
Filipe Rodrigues 2025-06-05 09:38:50 +01:00
parent ccd4ea1928
commit 6ca8ba9b0a
Signed by: zenithsiz
SSH Key Fingerprint: SHA256:Mb5ppb3Sh7IarBO/sBTXLHbYEOz37hJAlslLQPPAPaU
22 changed files with 159 additions and 83 deletions

View File

@ -71,12 +71,18 @@ web-sys = "0.3.77"
[workspace.lints]
clippy.nursery = { level = "warn", priority = -1 }
clippy.pedantic = { level = "warn", priority = -1 }
clippy.nursery = { level = "warn", priority = -1 }
clippy.pedantic = { level = "warn", priority = -1 }
clippy.restriction = { level = "warn", priority = -1 }
# We enable restriction group and then allow any we don't care
clippy.blanket_clippy_restriction_lints = "allow"
# Styling
clippy.implicit_return = "allow"
clippy.match_bool = "allow"
clippy.option_if_let_else = "allow"
clippy.ref_patterns = "allow"
clippy.single_match_else = "allow"
# It's easier to define them before their first usage
@ -88,9 +94,59 @@ clippy.future_not_send = "allow"
# Most times, the panics are internal assertions that the user can't trigger
clippy.missing_panics_doc = "allow"
clippy.unwrap_in_result = "allow"
# Shadowing is fine
# TODO: Turn off `unrelated` every once in a while?
clippy.shadow_reuse = "allow"
clippy.shadow_same = "allow"
clippy.shadow_unrelated = "allow"
# We want to use match ergonomics
clippy.pattern_type_mismatch = "allow"
# We sometimes need to explicitly panic
clippy.panic = "allow"
clippy.unreachable = "allow"
# Misc.
clippy.arbitrary_source_item_ordering = "allow"
clippy.arithmetic_side_effects = "allow"
clippy.exhaustive_enums = "allow"
clippy.exhaustive_structs = "allow"
clippy.expect_used = "allow"
clippy.impl_trait_in_params = "allow"
clippy.indexing_slicing = "allow"
clippy.mem_forget = "allow"
clippy.min_ident_chars = "allow"
clippy.missing_docs_in_private_items = "allow"
clippy.module_name_repetitions = "allow"
clippy.pub_use = "allow"
clippy.pub_with_shorthand = "allow"
clippy.question_mark_used = "allow"
clippy.self_named_module_files = "allow"
clippy.separated_literal_suffix = "allow"
clippy.single_call_fn = "allow"
clippy.single_char_lifetime_names = "allow"
clippy.string_slice = "allow"
clippy.unused_trait_names = "allow"
clippy.wildcard_enum_match_arm = "allow"
# False positives for tests in `tests/`.
clippy.tests_outside_test_module = "allow"
# TODO: Should we document all errors?
clippy.missing_errors_doc = "allow"
# TODO: Should we mark all of them as inline
clippy.missing_inline_in_public_items = "allow"
# TODO: Should we turn this off every once a while to check if we're missing any
# default items we can implement better?
clippy.missing_trait_methods = "allow"
# TODO: Should we move to `alloc`?
clippy.std_instead_of_alloc = "allow"
# Until `wasm_bindgen` themselves fix it upstream, we can't fix ourselves
rust.wasm_c_abi = "allow"

View File

@ -363,6 +363,7 @@ impl Prop {
let ident = name_value.path.get_ident().expect("Expected identifier");
match ident.to_string().as_str() {
"name" => match name_value.value {
#[expect(clippy::shadow_unrelated, reason = "It's related")]
syn::Expr::Path(ref path) if let Some(ident) = path.path.get_ident() => {
prop_ident = Some(ident.clone());
},

View File

@ -5,4 +5,4 @@ pub use dynatos_builder_macros::builder;
/// Missing prop
#[derive(Clone, Copy, Default, Debug)]
pub struct MissingProp;
pub struct MissingProp(());

View File

@ -285,76 +285,76 @@ mod test {
#[test]
fn simple() {
let handle = crate::provide::<i32>(5);
let handle = crate::provide::<usize>(5);
assert_eq!(crate::get::<i32>(), Some(5));
assert_eq!(crate::get::<usize>(), Some(5));
assert_eq!(handle.take(), 5);
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), None);
}
#[test]
fn stacked() {
let handle1 = crate::provide::<i32>(5);
let handle2 = crate::provide::<i32>(4);
let handle1 = crate::provide::<usize>(5);
let handle2 = crate::provide::<usize>(4);
assert_eq!(crate::get::<i32>(), Some(4));
assert_eq!(crate::get::<usize>(), Some(4));
assert_eq!(handle2.take(), 4);
assert_eq!(crate::get::<i32>(), Some(5));
assert_eq!(crate::get::<usize>(), Some(5));
assert_eq!(handle1.take(), 5);
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), None);
}
#[test]
fn stacked_swapped() {
let handle1 = crate::provide::<i32>(5);
let handle2 = crate::provide::<i32>(4);
let handle1 = crate::provide::<usize>(5);
let handle2 = crate::provide::<usize>(4);
assert_eq!(crate::get::<i32>(), Some(4));
assert_eq!(crate::get::<usize>(), Some(4));
assert_eq!(handle1.take(), 5);
assert_eq!(crate::get::<i32>(), Some(4));
assert_eq!(crate::get::<usize>(), Some(4));
assert_eq!(handle2.take(), 4);
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), None);
}
#[test]
fn stacked_triple() {
let handle1 = crate::provide::<i32>(5);
let handle2 = crate::provide::<i32>(4);
let handle3 = crate::provide::<i32>(3);
let handle1 = crate::provide::<usize>(5);
let handle2 = crate::provide::<usize>(4);
let handle3 = crate::provide::<usize>(3);
assert_eq!(crate::get::<i32>(), Some(3));
assert_eq!(crate::get::<usize>(), Some(3));
assert_eq!(handle2.take(), 4);
assert_eq!(handle3.take(), 3);
assert_eq!(crate::get::<i32>(), Some(5));
assert_eq!(crate::get::<usize>(), Some(5));
assert_eq!(handle1.take(), 5);
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), None);
}
#[test]
fn opaque() {
let handle1 = crate::provide::<i32>(5).into_opaque();
let handle2 = crate::provide::<i32>(4).into_opaque();
let handle1 = crate::provide::<usize>(5).into_opaque();
let handle2 = crate::provide::<usize>(4).into_opaque();
assert_eq!(crate::get::<i32>(), Some(4));
assert_eq!(*handle2.take().downcast::<i32>().expect("Handle had wrong type"), 4);
assert_eq!(crate::get::<i32>(), Some(5));
assert_eq!(*handle1.take().downcast::<i32>().expect("Handle had wrong type"), 5);
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), Some(4));
assert_eq!(*handle2.take().downcast::<usize>().expect("Handle had wrong type"), 4);
assert_eq!(crate::get::<usize>(), Some(5));
assert_eq!(*handle1.take().downcast::<usize>().expect("Handle had wrong type"), 5);
assert_eq!(crate::get::<usize>(), None);
}
#[test]
fn stress() {
let handles_len = 100;
let mut handles = (0..handles_len).map(crate::provide::<i32>).collect::<Vec<_>>();
let mut handles = (0..handles_len).map(crate::provide::<usize>).collect::<Vec<_>>();
for value in (0..handles_len).rev() {
assert_eq!(crate::get::<i32>(), Some(value));
assert_eq!(crate::get::<usize>(), Some(value));
let handle = handles.pop().expect("Should have handle");
assert_eq!(handle.get(), value);
assert_eq!(handle.take(), value);
}
assert_eq!(crate::get::<i32>(), None);
assert_eq!(crate::get::<usize>(), None);
}
// Type and value to test for the accesses

View File

@ -13,7 +13,10 @@ pub mod context_stack;
pub use self::context_stack::{ContextStack, ContextStackGlobal, ContextStackOpaque, ContextStackThreadLocal};
// Imports
use dynatos_world::{World, WorldGlobal, WorldThreadLocal};
use {
core::any::Any as StdAny,
dynatos_world::{World, WorldGlobal, WorldThreadLocal},
};
/// Context world
pub trait ContextWorld: World {
@ -26,12 +29,12 @@ pub trait ContextWorld: World {
impl ContextWorld for WorldThreadLocal {
type ContextStack<T> = ContextStackThreadLocal<T>;
type ContextStackOpaque = ContextStackThreadLocal<dyn core::any::Any>;
type ContextStackOpaque = ContextStackThreadLocal<dyn StdAny>;
}
impl ContextWorld for WorldGlobal {
type ContextStack<T> = ContextStackGlobal<T>;
type ContextStackOpaque = ContextStackGlobal<dyn core::any::Any>;
type ContextStackOpaque = ContextStackGlobal<dyn StdAny>;
}
/// Handle type for the world's context stack

View File

@ -1,5 +1,8 @@
//! Context stack
// Lints
#![expect(clippy::as_conversions, reason = "We need to unsize items and there's no other way")]
// Imports
use {
crate::ContextWorld,

View File

@ -5,6 +5,7 @@ use {
crate::WeakRef,
dynatos_util::TryOrReturnExt,
wasm_bindgen::{closure::Closure, convert::FromWasmAbi, JsCast},
web_sys::js_sys,
};
/// Extension trait to define an event listener on an event target with a closure
@ -21,7 +22,7 @@ where
// Build the closure
let closure = Closure::<dyn Fn(E::Event)>::new(f)
.into_js_value()
.dyn_into::<web_sys::js_sys::Function>()
.dyn_into::<js_sys::Function>()
.expect("Should be a valid function");
// Then add it

View File

@ -16,9 +16,9 @@ pub use self::{
// Imports
use {
core::fmt,
itertools::Itertools,
js_sys::Reflect,
std::fmt,
wasm_bindgen::{JsCast, JsValue},
};

View File

@ -425,8 +425,8 @@ where
type Signal = Loadable<Signal<T>, Signal<E>>;
type SignalsStorage = SplitValueStorage<T, E>;
fn get_signal(storage: &Self::SignalsStorage, cur: &Self::SigKind) -> Option<Self::Signal> {
let signal = match cur {
fn get_signal(storage: &Self::SignalsStorage, kind: &Self::SigKind) -> Option<Self::Signal> {
let signal = match kind {
Loadable::Empty => Loadable::Empty,
Loadable::Err(()) => Loadable::Err(storage.err.as_ref()?.signal()),
Loadable::Loaded(()) => Loadable::Loaded(storage.loaded.as_ref()?.signal()),

View File

@ -26,7 +26,7 @@ use {
ops::{Deref, DerefMut},
},
dynatos_world::{IMut, IMutLike, IMutRef, IMutRefMut, IMutRefMutLike, Rc, RcLike, WorldDefault},
futures::stream::AbortHandle,
futures::{future, stream::AbortHandle},
tokio::sync::Notify,
};
@ -87,7 +87,7 @@ impl<F: Loader, W: AsyncReactiveWorld<F>> Inner<F, W> {
// Then spawn the future
// TODO: Allow using something other than `wasm_bindgen_futures`?
let (fut, handle) = futures::future::abortable(self.loader.load());
let (fut, handle) = future::abortable(self.loader.load());
wasm_bindgen_futures::spawn_local(async move {
// Load the value
// Note: If we get aborted, just remove the handle

View File

@ -17,9 +17,10 @@ use {
},
core::{
fmt,
hash::Hash,
hash::{Hash, Hasher},
marker::{PhantomData, Unsize},
ops::CoerceUnsized,
ptr,
sync::atomic::{self, AtomicBool},
},
dynatos_world::{IMut, IMutLike, Rc, RcLike, Weak, WeakLike, WorldDefault},
@ -288,7 +289,7 @@ impl<F: ?Sized, W: ReactiveWorld> Effect<F, W> {
impl<F1: ?Sized, F2: ?Sized, W: ReactiveWorld> PartialEq<Effect<F2, W>> for Effect<F1, W> {
fn eq(&self, other: &Effect<F2, W>) -> bool {
core::ptr::eq(self.inner_ptr(), other.inner_ptr())
ptr::eq(self.inner_ptr(), other.inner_ptr())
}
}
@ -303,7 +304,7 @@ impl<F: ?Sized, W: ReactiveWorld> Clone for Effect<F, W> {
}
impl<F: ?Sized, W: ReactiveWorld> Hash for Effect<F, W> {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
fn hash<H: Hasher>(&self, state: &mut H) {
Rc::<_, W>::as_ptr(&self.inner).hash(state);
}
}
@ -367,7 +368,7 @@ impl<F: ?Sized, W: ReactiveWorld> WeakEffect<F, W> {
impl<F1: ?Sized, F2: ?Sized, W: ReactiveWorld> PartialEq<WeakEffect<F2, W>> for WeakEffect<F1, W> {
fn eq(&self, other: &WeakEffect<F2, W>) -> bool {
core::ptr::eq(self.inner_ptr(), other.inner_ptr())
ptr::eq(self.inner_ptr(), other.inner_ptr())
}
}
@ -383,7 +384,7 @@ impl<F: ?Sized, W: ReactiveWorld> Clone for WeakEffect<F, W> {
impl<F: ?Sized, W: ReactiveWorld> Hash for WeakEffect<F, W> {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
fn hash<H: Hasher>(&self, state: &mut H) {
self.inner_ptr().hash(state);
}
}
@ -539,7 +540,7 @@ mod test {
#[bench]
fn get_running_100_none(bencher: &mut Bencher) {
bencher.iter(|| {
for _ in 0..100 {
for _ in 0_usize..100 {
let effect = effect::running();
test::black_box(effect);
}
@ -552,7 +553,7 @@ mod test {
effect.gather_dependencies(|| {
bencher.iter(|| {
for _ in 0..100 {
for _ in 0_usize..100 {
let effect = effect::running();
test::black_box(effect);
}
@ -563,7 +564,7 @@ mod test {
#[bench]
fn create_10(bencher: &mut Bencher) {
bencher.iter(|| {
for _ in 0..10 {
for _ in 0_usize..10 {
let effect = Effect::new(move || ());
test::black_box(&effect);
mem::forget(effect);

View File

@ -239,8 +239,8 @@ where
type Signal = Option<Signal<T>>;
type SignalsStorage = Option<SignalStorage<T>>;
fn get_signal(storage: &Self::SignalsStorage, cur: &Self::SigKind) -> Option<Self::Signal> {
let signal = match cur {
fn get_signal(storage: &Self::SignalsStorage, kind: &Self::SigKind) -> Option<Self::Signal> {
let signal = match kind {
Some(()) => Some(storage.as_ref()?.signal()),
None => None,
};
@ -288,7 +288,7 @@ mod tests {
#[test]
fn exec() {
let input = Signal::new(Either2::<i32, ()>::T2(()));
let input = Signal::new(Either2::<usize, ()>::T2(()));
#[cloned(input)]
let signal = EnumSplitSignal::new(input);
@ -363,7 +363,7 @@ mod tests {
#[test]
fn write_back() {
// Start with `T1`
let outer = Signal::new(Either2::<i32, &'static str>::T1(5));
let outer = Signal::new(Either2::<usize, &'static str>::T1(5));
#[thread_local]
static TIMES_RUN_OUTER: Cell<usize> = Cell::new(0);
#[cloned(outer)]

View File

@ -364,7 +364,7 @@ mod test {
#[test]
fn basic() {
let outer = Signal::new(Ok::<_, ()>(5));
let outer = Signal::new(Ok::<usize, ()>(5));
// Counts the number of times that `outer` was written to
#[thread_local]
@ -407,7 +407,7 @@ mod test {
#[test]
fn effects() {
let outer = Signal::new(Ok::<_, i32>(5));
let outer = Signal::new(Ok::<usize, usize>(5));
let mapped = TryMappedSignal::new(outer.clone(), |opt| *opt, |opt, &value| *opt = Ok(value));
// Counts the times that the mapped signal was run

View File

@ -221,7 +221,7 @@ impl<T: ?Sized + fmt::Debug, W: ReactiveWorld> fmt::Debug for Signal<T, W> {
mod test {
// Imports
extern crate test;
use {super::*, crate::Effect, test::Bencher, zutil_cloned::cloned};
use {super::*, crate::Effect, core::array, test::Bencher, zutil_cloned::cloned};
#[test]
fn multiple_mut() {
@ -240,7 +240,7 @@ mod test {
#[bench]
fn clone_100(bencher: &mut Bencher) {
let signals = core::array::from_fn::<_, 100, _>(|_| Signal::new(0_i32));
let signals = array::from_fn::<_, 100, _>(|_| Signal::new(0_i32));
bencher.iter(|| {
for signal in &signals {
let signal = test::black_box(signal.clone());
@ -252,7 +252,7 @@ mod test {
/// Reference for [`access_100`]
#[bench]
fn access_100_value(bencher: &mut Bencher) {
let values = core::array::from_fn::<_, 100, _>(|_| 123_usize);
let values = array::from_fn::<_, 100, _>(|_| 123_usize);
bencher.iter(|| {
for value in &values {
test::black_box(*value);
@ -262,7 +262,7 @@ mod test {
#[bench]
fn access_100(bencher: &mut Bencher) {
let signals = core::array::from_fn::<_, 100, _>(|_| Signal::new(123_usize));
let signals = array::from_fn::<_, 100, _>(|_| Signal::new(123_usize));
bencher.iter(|| {
for signal in &signals {
test::black_box(signal.get());
@ -273,7 +273,7 @@ mod test {
/// Reference for `update_100_*`
#[bench]
fn update_100_value(bencher: &mut Bencher) {
let mut values = core::array::from_fn::<_, 100, _>(|_| 123_usize);
let mut values = array::from_fn::<_, 100, _>(|_| 123_usize);
bencher.iter(|| {
for value in &mut values {
*value += 1;
@ -284,7 +284,7 @@ mod test {
#[bench]
fn update_100_empty(bencher: &mut Bencher) {
let signals = core::array::from_fn::<_, 100, _>(|_| Signal::new(123_usize));
let signals = array::from_fn::<_, 100, _>(|_| Signal::new(123_usize));
bencher.iter(|| {
for signal in &signals {
signal.update(|value| *value += 1);

View File

@ -10,8 +10,9 @@ use {
borrow::Borrow,
fmt,
hash::{Hash, Hasher},
marker::PhantomData,
marker::{PhantomData, Unsize},
ops::CoerceUnsized,
ptr,
},
dynatos_world::{IMut, IMutLike, Rc, RcLike, Weak, WeakLike, WorldDefault},
std::collections::{hash_map, HashMap},
@ -304,7 +305,7 @@ impl<W: ReactiveWorld + Default> Default for Trigger<W> {
impl<W: ReactiveWorld> PartialEq for Trigger<W> {
fn eq(&self, other: &Self) -> bool {
core::ptr::eq(Rc::<_, W>::as_ptr(&self.inner), Rc::<_, W>::as_ptr(&other.inner))
ptr::eq(Rc::<_, W>::as_ptr(&self.inner), Rc::<_, W>::as_ptr(&other.inner))
}
}
@ -348,7 +349,7 @@ impl<W: ReactiveWorld> WeakTrigger<W> {
impl<W: ReactiveWorld> PartialEq for WeakTrigger<W> {
fn eq(&self, other: &Self) -> bool {
core::ptr::eq(Weak::<_, W>::as_ptr(&self.inner), Weak::<_, W>::as_ptr(&other.inner))
ptr::eq(Weak::<_, W>::as_ptr(&self.inner), Weak::<_, W>::as_ptr(&other.inner))
}
}
@ -402,7 +403,7 @@ impl<W: ReactiveWorld> IntoSubscriber<W> for Subscriber<W> {
)]
impl<F, W> IntoSubscriber<W> for T<F, W>
where
F: ?Sized + core::marker::Unsize<W::F>,
F: ?Sized + Unsize<W::F>,
W: ReactiveWorld,
WeakEffect<F, W>: CoerceUnsized<WeakEffect<W::F, W>>,
{
@ -472,7 +473,7 @@ mod test {
extern crate test;
use {
super::*,
core::{cell::Cell, mem},
core::{array, cell::Cell, mem},
test::Bencher,
};
@ -568,7 +569,7 @@ mod test {
#[bench]
fn clone_100(bencher: &mut Bencher) {
let triggers = core::array::from_fn::<Trigger, 100, _>(|_| Trigger::new());
let triggers = array::from_fn::<Trigger, 100, _>(|_| Trigger::new());
bencher.iter(|| {
for trigger in &triggers {
let trigger = test::black_box(trigger.clone());
@ -580,7 +581,7 @@ mod test {
/// Benches triggering a trigger with `N` no-op effects.
fn trigger_noop_n<const N: usize>(bencher: &mut Bencher) {
let trigger = Trigger::new();
let effects = core::array::from_fn::<_, N, _>(|_| Effect::new(|| ()));
let effects = array::from_fn::<_, N, _>(|_| Effect::new(|| ()));
for effect in &effects {
trigger.add_subscriber(effect);
}

View File

@ -13,8 +13,8 @@ use {
/// Ensures that the run queue is breadth-first
#[test]
fn breadth_first() {
let a = Signal::new(5);
let b = Signal::new(6);
let a = Signal::new(5_usize);
let b = Signal::new(6_usize);
#[thread_local]
static ORDER: RefCell<Vec<&'static str>> = RefCell::new(vec![]);

View File

@ -9,6 +9,7 @@ use {
#[test]
fn create_unsized() {
let value: i32 = 5;
#[expect(clippy::as_conversions, reason = "We need to unsize it")]
let sig = Signal::<i32>::new(value) as Signal<dyn Any>;
sig.with(|dyn_value| {

View File

@ -1,7 +1,10 @@
//! Inner-mutability types
// Imports
use core::{cell::RefCell, ops};
use core::{
cell::{self, RefCell},
ops,
};
/// Inner mutability family
pub trait IMutFamily: Sized {
@ -65,7 +68,7 @@ impl IMutFamily for StdRefcell {
impl<T: ?Sized> IMutLike<T> for RefCell<T> {
type Ref<'a>
= core::cell::Ref<'a, T>
= cell::Ref<'a, T>
where
Self: 'a;
type RefMut<'a>
@ -103,7 +106,7 @@ impl<T: ?Sized> IMutLike<T> for RefCell<T> {
}
}
impl<'a, T: ?Sized> IMutRefLike<'a, T> for core::cell::Ref<'a, T> {
impl<'a, T: ?Sized> IMutRefLike<'a, T> for cell::Ref<'a, T> {
type IMut = RefCell<T>;
}
@ -114,7 +117,7 @@ pub struct RefCellRefMut<'a, T: ?Sized> {
/// Borrow
#[deref(forward)]
#[deref_mut]
borrow: core::cell::RefMut<'a, T>,
borrow: cell::RefMut<'a, T>,
/// Original refcell
// Note: This field is necessary for downgrading.

View File

@ -1,7 +1,10 @@
//! Reference-counted pointer
// Imports
use core::ops;
use {
core::ops,
std::{rc, sync},
};
/// Reference-counted pointer family
pub trait RcFamily: Sized {
@ -51,11 +54,11 @@ pub trait WeakLike<T: ?Sized>: Clone {
pub struct StdArc;
impl RcFamily for StdArc {
type Rc<T: ?Sized> = std::sync::Arc<T>;
type Weak<T: ?Sized> = std::sync::Weak<T>;
type Rc<T: ?Sized> = sync::Arc<T>;
type Weak<T: ?Sized> = sync::Weak<T>;
}
impl<T: ?Sized> RcLike<T> for std::sync::Arc<T> {
impl<T: ?Sized> RcLike<T> for sync::Arc<T> {
type Family = StdArc;
fn new(value: T) -> Self
@ -82,7 +85,7 @@ impl<T: ?Sized> RcLike<T> for std::sync::Arc<T> {
}
}
impl<T: ?Sized> WeakLike<T> for std::sync::Weak<T> {
impl<T: ?Sized> WeakLike<T> for sync::Weak<T> {
type Family = StdArc;
fn upgrade(&self) -> Option<<Self::Family as RcFamily>::Rc<T>> {
@ -98,11 +101,11 @@ impl<T: ?Sized> WeakLike<T> for std::sync::Weak<T> {
pub struct StdRc;
impl RcFamily for StdRc {
type Rc<T: ?Sized> = std::rc::Rc<T>;
type Weak<T: ?Sized> = std::rc::Weak<T>;
type Rc<T: ?Sized> = rc::Rc<T>;
type Weak<T: ?Sized> = rc::Weak<T>;
}
impl<T: ?Sized> RcLike<T> for std::rc::Rc<T> {
impl<T: ?Sized> RcLike<T> for rc::Rc<T> {
type Family = StdRc;
fn new(value: T) -> Self
@ -129,7 +132,7 @@ impl<T: ?Sized> RcLike<T> for std::rc::Rc<T> {
}
}
impl<T: ?Sized> WeakLike<T> for std::rc::Weak<T> {
impl<T: ?Sized> WeakLike<T> for rc::Weak<T> {
type Family = StdRc;
fn upgrade(&self) -> Option<<Self::Family as RcFamily>::Rc<T>> {

View File

@ -207,6 +207,7 @@ impl DynAttrPred for bool {
impl<Generics> DynAttrPred for Ty {
fn eval(&self) -> bool {
#[allow(
clippy::allow_attributes,
clippy::redundant_closure_for_method_calls,
reason = "In some branches it isn't redundant"
)]

View File

@ -179,6 +179,7 @@ where
impl<Generics> ToDynNode for Ty {
fn to_node(&self) -> Option<web_sys::Node> {
#[allow(
clippy::allow_attributes,
clippy::redundant_closure_for_method_calls,
reason = "In some branches it isn't redundant"
)]

View File

@ -156,6 +156,7 @@ impl ToDynProp for Ty {
impl<Generics> ToDynProp for Ty {
fn to_prop(&self) -> Option<JsValue> {
#[allow(
clippy::allow_attributes,
clippy::redundant_closure_for_method_calls,
reason = "In some branches it isn't redundant"
)]