clippy fix
All checks were successful
buildbot/cargo fmt (1.72) Build done.
buildbot/cargo doc (1.72) Build done.
buildbot/cargo clippy (1.65) Build done.
buildbot/cargo clippy (1.72) Build done.
buildbot/cargo test (1.65) Build done.

This commit is contained in:
AF 2025-02-25 07:49:38 +00:00
parent 5d4116d588
commit cf49c3b8c5
Signed by: alisa
SSH Key Fingerprint: SHA256:vNY4pdIZvO1FYJKHROkdHLtvyopizvZVAEwg9AF6h04
16 changed files with 34 additions and 26 deletions

View File

@ -7,7 +7,8 @@ use super::{weakfunctorany::WeakFunctorAny, Functor, Pure, WeakFunctor, Wrap};
pub(super) struct ControlFlowInstance<C>(ControlFlow<(), C>);
impl<C: Send> WeakFunctorAny for ControlFlowInstance<C> {
type FAny<'a, A: 'a + Send> = ControlFlow<A, C>
type FAny<'a, A: 'a + Send>
= ControlFlow<A, C>
where
Self: 'a;
}

View File

@ -41,7 +41,8 @@ impl<A, E: Effect> WithEffect<A, E> {
pub struct EffectInstance<E: Send>(E);
impl<E: Send> WeakFunctorAny for EffectInstance<E> {
type FAny<'a, A: 'a + Send> = WithEffect<A, E>
type FAny<'a, A: 'a + Send>
= WithEffect<A, E>
where
Self: 'a;
}

View File

@ -67,7 +67,7 @@ impl<'a> ApplicativeTuple<'a> for LazyInstance {
}
}
impl<'a> ApplicativeSelect<'a> for LazyInstance {}
impl ApplicativeSelect<'_> for LazyInstance {}
impl<'a> Applicative<'a> for LazyInstance {
fn discard_first<A: 'a + Send, B: 'a + Send>(fa: Self::F<A>, fb: Self::F<B>) -> Self::F<B> {

View File

@ -73,7 +73,7 @@ impl<'a> ApplicativeTuple<'a> for OptionInstance {
}
}
impl<'a> ApplicativeSelect<'a> for OptionInstance {}
impl ApplicativeSelect<'_> for OptionInstance {}
impl<'a> Applicative<'a> for OptionInstance {
fn discard_first<A: 'a + Send, B: 'a + Send>(fa: Self::F<A>, fb: Self::F<B>) -> Self::F<B> {

View File

@ -18,7 +18,10 @@ use crate::func::class_prelude::*;
pub struct ResultInstance<E: Send>(E);
impl<E: Send> WeakFunctorAny for ResultInstance<E> {
type FAny<'a, A: 'a + Send> = Result<A, E> where Self: 'a;
type FAny<'a, A: 'a + Send>
= Result<A, E>
where
Self: 'a;
}
impl<'a, E: 'a + Send> Functor<'a> for ResultInstance<E> {

View File

@ -63,7 +63,7 @@ impl<'a> ApplicativeTuple<'a> for SoloInstance {
}
}
impl<'a> ApplicativeSelect<'a> for SoloInstance {}
impl ApplicativeSelect<'_> for SoloInstance {}
impl<'a> Applicative<'a> for SoloInstance {
fn discard_first<A: 'a + Send, B: 'a + Send>(fa: Self::F<A>, fb: Self::F<B>) -> Self::F<B> {

View File

@ -238,9 +238,9 @@ impl<'a> ApplicativeTuple<'a> for StacklessInstance {
}
}
impl<'a> ApplicativeSelect<'a> for StacklessInstance {}
impl ApplicativeSelect<'_> for StacklessInstance {}
impl<'a> Applicative<'a> for StacklessInstance {}
impl Applicative<'_> for StacklessInstance {}
impl<'a> Monad<'a> for StacklessInstance {
fn bind<A: 'a + Send, B: 'a + Send>(

View File

@ -20,7 +20,10 @@ use crate::func::class_prelude::*;
pub struct TryFutureInstance<E>(E);
impl<E: Send> WeakFunctorAny for TryFutureInstance<E> {
type FAny<'a, A: 'a + Send> = Pin<Box<dyn 'a + Send + Future<Output = Result<A, E>>>> where Self: 'a;
type FAny<'a, A: 'a + Send>
= Pin<Box<dyn 'a + Send + Future<Output = Result<A, E>>>>
where
Self: 'a;
}
impl<'a, E: 'a + Send> Functor<'a> for TryFutureInstance<E> {

View File

@ -21,7 +21,7 @@ impl<'a> From<&'a [u8]> for SliceDeserializer<'a> {
}
}
impl<'a> Deserializer for SliceDeserializer<'a> {
impl Deserializer for SliceDeserializer<'_> {
fn read_n(&mut self, n: usize) -> &[u8] {
let (slice_l, slice_r) = self.slice.split_at(min(n, self.slice.len()));
self.slice = slice_r;

View File

@ -31,7 +31,7 @@ pub(super) trait InliningAddresses<E>: Stream {
}
}
impl<E, D: ?Sized + Stream> InliningAddresses<E> for D {}
impl<E, D: Stream> InliningAddresses<E> for D {}
fn parse_slice<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>>(
factory: &F,

View File

@ -38,7 +38,7 @@ impl<A: AtomicBase> Serializable for AtomicObject<A> {
}
}
impl<'a, A: AtomicBase> MentionableBase<'a> for AtomicObject<A> {
impl<A: AtomicBase> MentionableBase<'_> for AtomicObject<A> {
type Fctr = AtomicFactory<A>;
fn factory(&self) -> Self::Fctr {
@ -71,7 +71,7 @@ impl<A: AtomicBase> Clone for AtomicFactory<A> {
}
}
impl<'a, A: AtomicBase> FactoryBase<'a> for AtomicFactory<A> {
impl<A: AtomicBase> FactoryBase<'_> for AtomicFactory<A> {
type Mtbl = AtomicObject<A>;
type ParseError = A::AParseError;

View File

@ -41,13 +41,13 @@ struct ParallelBox<'a>(&'a TraceBox);
struct SequentialBox<'a>(&'a TraceBox);
impl<'a> Display for ParallelBox<'a> {
impl Display for ParallelBox<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.trace.fmt_parallel(f)
}
}
impl<'a> Display for SequentialBox<'a> {
impl Display for SequentialBox<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.trace.fmt_sequential(f)
}

View File

@ -83,13 +83,13 @@ impl<'a, Ctx: Context<'a>> Clone for TypelessFactory<'a, Ctx> {
#[derive(Debug)]
pub struct TypelessError<'a>(Box<dyn 'a + Send + Error>);
impl<'a> Display for TypelessError<'a> {
impl Display for TypelessError<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "typeless error: {}", self.0)
}
}
impl<'a> Error for TypelessError<'a> {}
impl Error for TypelessError<'_> {}
impl<'a, Ctx: Context<'a>> FactoryBase<'a> for TypelessFactory<'a, Ctx> {
type Mtbl = TypelessMentionable<'a, Ctx>;

View File

@ -40,13 +40,13 @@ impl<'a> From<TypelessError<'a>> for TestLookupError<'a> {
}
}
impl<'a> From<SingularError> for TestLookupError<'a> {
impl From<SingularError> for TestLookupError<'_> {
fn from(value: SingularError) -> Self {
Self::Singular(value)
}
}
impl<'a> Display for TestLookupError<'a> {
impl Display for TestLookupError<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Typeless(typeless_error) => {
@ -62,13 +62,13 @@ impl<'a> Display for TestLookupError<'a> {
}
}
impl<'a> Error for TestLookupError<'a> {}
impl Error for TestLookupError<'_> {}
impl<'a> FunctorContext<'a> for TestContextPlain {
impl FunctorContext<'_> for TestContextPlain {
type T = instances::solo::SoloInstance;
}
impl<'a> FallibleCtx<'a> for TestContextPlain {
impl FallibleCtx<'_> for TestContextPlain {
type Fallible = instances::result::ResultFailAny;
}

View File

@ -6,11 +6,11 @@ use super::*;
pub struct TestContextCounted;
impl<'a> FunctorContext<'a> for TestContextCounted {
impl FunctorContext<'_> for TestContextCounted {
type T = CountedInstance;
}
impl<'a> FallibleCtx<'a> for TestContextCounted {
impl FallibleCtx<'_> for TestContextCounted {
type Fallible = instances::result::ResultFailOver<Self::T>;
}

View File

@ -6,11 +6,11 @@ use super::*;
pub struct TestContextTraced;
impl<'a> FunctorContext<'a> for TestContextTraced {
impl FunctorContext<'_> for TestContextTraced {
type T = TracedInstance;
}
impl<'a> FallibleCtx<'a> for TestContextTraced {
impl FallibleCtx<'_> for TestContextTraced {
type Fallible = instances::result::ResultFailOver<Self::T>;
}