fixed check lints
| -rw-r--r-- | src/any/indirect.rs | 6 | ||||
| -rw-r--r-- | src/build.rs | 3 | ||||
| -rw-r--r-- | src/build/builders/core/bool.rs | 2 | ||||
| -rw-r--r-- | src/effect.rs | 2 | ||||
| -rw-r--r-- | src/effect/blocking.rs | 4 | ||||
| -rw-r--r-- | src/lib.rs | 9 | ||||
| -rw-r--r-- | src/protocol/visitor.rs | 2 | ||||
| -rw-r--r-- | src/protocol/visitor/recoverable.rs | 3 | ||||
| -rw-r--r-- | src/protocol/visitor/request_hint.rs | 3 | ||||
| -rw-r--r-- | src/protocol/visitor/sequence.rs | 3 | ||||
| -rw-r--r-- | src/protocol/visitor/tag.rs | 1 | ||||
| -rw-r--r-- | src/protocol/visitor/value.rs | 3 | ||||
| -rw-r--r-- | src/protocol/walker/hint.rs | 1 | ||||
| -rw-r--r-- | src/transform.rs | 15 | ||||
| -rw-r--r-- | src/walk.rs | 2 | ||||
| -rw-r--r-- | src/walk/walkers/core/key_value.rs | 19 | ||||
| -rw-r--r-- | src/walk/walkers/core/noop.rs | 2 | ||||
| -rw-r--r-- | src/walk/walkers/core/struct.rs | 46 | ||||
| -rw-r--r-- | src/walk/walkers/core/tag.rs | 17 | ||||
| -rw-r--r-- | src/walk/walkers/core/value.rs | 6 |
20 files changed, 61 insertions, 88 deletions
diff --git a/src/any/indirect.rs b/src/any/indirect.rs index ffd3b78..f337e02 100644 --- a/src/any/indirect.rs +++ b/src/any/indirect.rs @@ -72,19 +72,19 @@ pub(super) mod sealed { const INDIRECT_SIZE: usize = core::mem::size_of::<usize>() * 2; /// Helper trait for double checking the sizes of fat pointers. - trait Helper { + trait _Helper { fn run(&self); } const _: () = assert!( - core::mem::size_of::<&dyn Helper>() <= core::mem::size_of::<RawIndirect<'_, Ref>>() + core::mem::size_of::<&dyn _Helper>() <= core::mem::size_of::<RawIndirect<'_, Ref>>() ); // Borrow doesn't need to be dropped. const _: () = assert!(!core::mem::needs_drop::<&i32>()); const _: () = assert!( - core::mem::size_of::<&mut dyn Helper>() + core::mem::size_of::<&mut dyn _Helper>() <= core::mem::size_of::<sealed::RawIndirect<'_, Mut>>() ); diff --git a/src/build.rs b/src/build.rs index 293e395..51404a4 100644 --- a/src/build.rs +++ b/src/build.rs @@ -2,9 +2,8 @@ use core::fmt::{Debug, Display}; pub mod builders; use crate::{ - effect::{Effect, EffectiveExt as _, ErasedEffective}, + effect::{Effect, ErasedEffective}, protocol::DynVisitor, - transform, Walker, WalkerTypes, }; /// A buildable type. diff --git a/src/build/builders/core/bool.rs b/src/build/builders/core/bool.rs index efe7188..aa72f20 100644 --- a/src/build/builders/core/bool.rs +++ b/src/build/builders/core/bool.rs @@ -3,7 +3,7 @@ use core::{fmt::Display, marker::PhantomData}; use crate::{ any::OwnedStatic, any_trait, - effect::{Effect, Effective, ErasedEffective}, + effect::{Effect, ErasedEffective}, protocol::{ visitor::{Value, ValueProto, VisitResult}, DynVisitor, diff --git a/src/effect.rs b/src/effect.rs index 6e50862..14c13c2 100644 --- a/src/effect.rs +++ b/src/effect.rs @@ -3,7 +3,7 @@ pub mod blocking; use core::{future::Future, ops::ControlFlow}; -use crate::{higher_ranked_trait, higher_ranked_type, hkt::Marker, never::Never}; +use crate::never::Never; // Goal: code using the module shouldn't care if the underlying environment is async or not. // That is the API should allow yielding without forcing it. diff --git a/src/effect/blocking.rs b/src/effect/blocking.rs index c504445..b95e643 100644 --- a/src/effect/blocking.rs +++ b/src/effect/blocking.rs @@ -39,9 +39,9 @@ impl<B: BlockOn> Effect for Blocking<B> { Value(value, Default::default()) } - fn from_future<'a, F: Ss + 'a>(future: F) -> ErasedEffective<'a, F::Output, Self> + fn from_future<'a, F>(future: F) -> ErasedEffective<'a, F::Output, Self> where - F: Future, + F: Future + Ss + 'a, F::Output: Ss + 'a, { Value(B::block_on(future), Default::default()) @@ -243,14 +243,7 @@ macro_rules! Walk { // } pub mod demo { - use crate::{ - effect::{ - blocking::{BlockOn, Blocking, Spin}, - // r#async::Async, - Effective as _, - }, - transform, Build, BuildExt as _, DefaultMode, - }; + use crate::{Build, BuildExt as _}; use crate::{Walk, WalkExt as _}; use macro_rules_attribute::derive; diff --git a/src/protocol/visitor.rs b/src/protocol/visitor.rs index 6dc58fb..35f24ea 100644 --- a/src/protocol/visitor.rs +++ b/src/protocol/visitor.rs @@ -1,7 +1,7 @@ use core::ops::ControlFlow; use crate::{ - effect::{Effective, EffectiveExt as _, ErasedEffective, Ss}, + effect::{Effective, ErasedEffective, Ss}, never::Never, Flow, Status, }; diff --git a/src/protocol/visitor/recoverable.rs b/src/protocol/visitor/recoverable.rs index 00eaad4..ce7a181 100644 --- a/src/protocol/visitor/recoverable.rs +++ b/src/protocol/visitor/recoverable.rs @@ -1,7 +1,6 @@ use crate::{ any::TypeName, - effect::{Effect, Effective, ErasedEffective, ReadyExt as _}, - higher_ranked_type, + effect::{Effect, ErasedEffective, ReadyExt as _}, hkt::Marker, protocol::{ walker::hint::{HintMeta, Meta}, diff --git a/src/protocol/visitor/request_hint.rs b/src/protocol/visitor/request_hint.rs index 222770e..96eecb3 100644 --- a/src/protocol/visitor/request_hint.rs +++ b/src/protocol/visitor/request_hint.rs @@ -1,7 +1,6 @@ use crate::{ any::TypeName, - effect::{Effect, Effective, ErasedEffective, ReadyExt as _}, - higher_ranked_type, + effect::{Effect, ErasedEffective, ReadyExt as _}, hkt::Marker, protocol::{DynVisitor, DynWalker}, }; diff --git a/src/protocol/visitor/sequence.rs b/src/protocol/visitor/sequence.rs index c79f985..c525513 100644 --- a/src/protocol/visitor/sequence.rs +++ b/src/protocol/visitor/sequence.rs @@ -1,7 +1,6 @@ use crate::{ any::TypeName, - effect::{Effect, Effective, ErasedEffective, ReadyExt as _}, - higher_ranked_type, + effect::{Effect, ErasedEffective, ReadyExt as _}, hkt::Marker, protocol::{ walker::hint::{HintMeta, Meta}, diff --git a/src/protocol/visitor/tag.rs b/src/protocol/visitor/tag.rs index f1f0630..030cc56 100644 --- a/src/protocol/visitor/tag.rs +++ b/src/protocol/visitor/tag.rs @@ -3,7 +3,6 @@ use core::any::TypeId; use crate::{ any::TypeName, effect::{Effect, Effective, EffectiveExt, ErasedEffective, ReadyExt}, - higher_ranked_type, hkt::Marker, protocol::{ walker::hint::{HintMeta, Meta}, diff --git a/src/protocol/visitor/value.rs b/src/protocol/visitor/value.rs index 86063b1..82c7141 100644 --- a/src/protocol/visitor/value.rs +++ b/src/protocol/visitor/value.rs @@ -4,8 +4,7 @@ use crate::{ any::TypeName, - effect::{Effect, Effective, ErasedEffective, ReadyExt as _}, - higher_ranked_type, + effect::{Effect, ErasedEffective, ReadyExt as _}, hkt::Marker, protocol::{ walker::hint::{HintMeta, Meta}, diff --git a/src/protocol/walker/hint.rs b/src/protocol/walker/hint.rs index b013c61..e5a8a98 100644 --- a/src/protocol/walker/hint.rs +++ b/src/protocol/walker/hint.rs @@ -7,7 +7,6 @@ use crate::{ any::{AnyTrait, TypeName}, effect::{Effect, EffectiveExt as _, ErasedEffective, ReadyExt as _, Ss}, - higher_ranked_trait, higher_ranked_type, hkt::Marker, protocol::{visitor::VisitResult, DynVisitor, DynWalker}, Flow, diff --git a/src/transform.rs b/src/transform.rs index 881203c..6c4369e 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -1,9 +1,6 @@ -use core::marker::PhantomData; - use crate::{ build::Builder, effect::{blocking::Blocking, Effect, Effective, EffectiveExt, ErasedEffective}, - hkt::Marker, Build, BuilderTypes, DefaultMode, Walk, Walker, WalkerTypes, }; @@ -110,12 +107,12 @@ pub trait WalkExt { impl<T> WalkExt for T {} -/// For use in a lens. -pub struct Projection<T, B, U, M> { - value: T, - builder: B, - _marker: Marker<(U, M)>, -} +// /// For use in a lens. +// pub struct Projection<T, B, U, M> { +// value: T, +// builder: B, +// _marker: Marker<(U, M)>, +// } // #[allow(clippy::type_complexity)] // impl<T, B, U: Send + Sync, M> Projection<T, B, U, M> { diff --git a/src/walk.rs b/src/walk.rs index d15c6f4..c16f5ae 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -1,6 +1,6 @@ pub mod walkers; -use core::fmt::{Debug, Display}; +use core::fmt::Debug; use crate::{ effect::{Effect, Effective, EffectiveExt, ErasedEffective}, diff --git a/src/walk/walkers/core/key_value.rs b/src/walk/walkers/core/key_value.rs index 1adb7b1..1229375 100644 --- a/src/walk/walkers/core/key_value.rs +++ b/src/walk/walkers/core/key_value.rs @@ -1,24 +1,17 @@ -use core::marker::PhantomData; - use crate::{ effect::{Effect, EffectExt as _, Effective, EffectiveExt as _, ErasedEffective}, never::Never, protocol::{ - visitor::{ - tags, visit_tag, EffectiveVisitExt as _, TagConst, TagError, TagKind, VisitResult, - }, + visitor::{tags, visit_tag, EffectiveVisitExt as _, TagConst, TagError, TagKind}, DynVisitor, }, - walkers::core::noop::NoopWalker, - Flow, WalkerTypes, TAG_KEY, TAG_KEY_VALUE, TAG_VALUE, + Flow, WalkerTypes, }; -use super::value::ValueWalker; - pub struct KeyValueWalker<T, K, V> { key_walker: K, value_walker: V, - tag: T, + _tag: T, } impl<T, K, V> KeyValueWalker<T, K, V> { @@ -27,7 +20,7 @@ impl<T, K, V> KeyValueWalker<T, K, V> { Self { key_walker, value_walker, - tag, + _tag: tag, } } } @@ -68,7 +61,7 @@ where let Self { key_walker, value_walker, - tag, + _tag, } = self; E::as_ctx( @@ -96,7 +89,7 @@ where }, ) .remove_ctx() - .map(|visit| Ok(())) + .map(|_| Ok(())) // E::wrap(async move { // match visit_tag::<T, E, _>(self.tag, visitor.cast(), NoopWalker::new()).await { diff --git a/src/walk/walkers/core/noop.rs b/src/walk/walkers/core/noop.rs index d961d7e..e26eba4 100644 --- a/src/walk/walkers/core/noop.rs +++ b/src/walk/walkers/core/noop.rs @@ -1,5 +1,5 @@ use crate::{ - effect::{Effect, Effective, ErasedEffective}, + effect::{Effect, ErasedEffective}, never::Never, protocol::DynVisitor, WalkerTypes, diff --git a/src/walk/walkers/core/struct.rs b/src/walk/walkers/core/struct.rs index 45fba0e..fc4607a 100644 --- a/src/walk/walkers/core/struct.rs +++ b/src/walk/walkers/core/struct.rs @@ -1,4 +1,4 @@ -use core::{any::TypeId, marker::PhantomData}; +use core::any::TypeId; use crate::{ any::{AnyTrait, BorrowedStatic, BorrowedStaticHrt, StaticType}, @@ -8,10 +8,10 @@ use crate::{ never::Never, protocol::{ visitor::{ - visit_recoverable, visit_request_hint, visit_sequence, visit_tag, visit_value, - EffectiveVisitExt as _, RecoverableKnown, RecoverableProto, RecoverableScope, - SequenceKnown, SequenceProto, SequenceScope, TagConst, TagDyn, TagError, TagHint, - TagKnown, TagProto, ValueKnown, ValueProto, VisitResult, + visit_request_hint, visit_sequence, visit_tag, visit_value, EffectiveVisitExt as _, + RecoverableKnown, RecoverableProto, RecoverableScope, SequenceKnown, SequenceProto, + SequenceScope, TagConst, TagDyn, TagError, TagHint, TagKnown, TagProto, ValueKnown, + ValueProto, VisitResult, }, walker::hint::{Hint, HintMeta, HintProto, MetaHint, MetaKnown}, DynVisitor, DynWalker, @@ -19,7 +19,7 @@ use crate::{ Flow, Status, WalkerTypes, TAG_FIELD_NAMES, TAG_MAP, TAG_STRUCT, TAG_TYPE_ID, TAG_TYPE_NAME, }; -use super::{noop::NoopWalker, tag::StaticSliceWalker, value::ValueWalker}; +use super::{noop::NoopWalker, value::ValueWalker}; /// Walker for a borrow of a struct. /// @@ -128,8 +128,8 @@ where { #[inline(always)] fn walk<'b: 'c, 'c>( - mut self, - mut visitor: DynVisitor<'b, 'ctx>, + self, + visitor: DynVisitor<'b, 'ctx>, ) -> ErasedEffective<'c, Result<Self::Output, Self::Error>, E> where Self: 'c, @@ -190,8 +190,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, RecoverableProto<E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, RecoverableProto<E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -224,8 +224,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -272,8 +272,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -320,8 +320,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -365,7 +365,7 @@ where fn hint<'this: 'e, 'visitor: 'e, 'hint: 'e, 'e>( &'this mut self, visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>, + _hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -418,8 +418,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -533,8 +533,8 @@ where #[inline(always)] fn hint<'this, 'visitor, 'hint, 'e>( &'this mut self, - visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, ValueProto<BorrowedStaticHrt<I::T>, E>>, + _visitor: DynVisitor<'visitor, 'ctx>, + _hint: MetaHint<'hint, 'ctx, ValueProto<BorrowedStaticHrt<I::T>, E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, @@ -564,11 +564,11 @@ where I: StructTypeInfo<'ctx, M, S = S>, { #[inline(always)] - #[inline(always)] + fn hint<'this: 'e, 'visitor: 'e, 'hint: 'e, 'e>( &'this mut self, visitor: DynVisitor<'visitor, 'ctx>, - hint: MetaHint<'hint, 'ctx, SequenceProto<E>>, + _hint: MetaHint<'hint, 'ctx, SequenceProto<E>>, ) -> ErasedEffective<'e, Flow, E> where 'ctx: 'this + 'visitor + 'hint + 'e, diff --git a/src/walk/walkers/core/tag.rs b/src/walk/walkers/core/tag.rs index d2b170f..47c8e27 100644 --- a/src/walk/walkers/core/tag.rs +++ b/src/walk/walkers/core/tag.rs @@ -1,15 +1,12 @@ use core::marker::PhantomData; use crate::{ - any::OwnedStatic, any_trait, - effect::{Effect, Effective, ErasedEffective}, + effect::{Effect, ErasedEffective}, never::Never, protocol::{ - visitor::{ - visit_request_hint, visit_value, SequenceProto, SequenceScope, TagError, VisitResult, - }, - DynVisitor, DynWalker, + visitor::{SequenceScope, TagError}, + DynVisitor, }, Flow, WalkerTypes, }; @@ -45,8 +42,8 @@ where { #[inline(always)] fn walk<'b: 'c, 'c>( - mut self, - mut visitor: DynVisitor<'b, 'ctx>, + self, + _visitor: DynVisitor<'b, 'ctx>, ) -> ErasedEffective<'c, Result<Self::Output, Self::Error>, E> { todo!() // E::wrap(async move { @@ -86,9 +83,9 @@ where #[inline(always)] fn next<'a: 'c, 'b: 'c, 'c>( &'a mut self, - visitor: DynVisitor<'b, 'ctx>, + _visitor: DynVisitor<'b, 'ctx>, ) -> ErasedEffective<'c, Flow, E> { - if let Some(name) = self.names.get(self.current) { + if let Some(_name) = self.names.get(self.current) { self.current += 1; todo!() // E::wrap(async move { diff --git a/src/walk/walkers/core/value.rs b/src/walk/walkers/core/value.rs index 72715cb..598e641 100644 --- a/src/walk/walkers/core/value.rs +++ b/src/walk/walkers/core/value.rs @@ -1,6 +1,6 @@ use crate::{ - any::{BorrowedStatic, OwnedStatic}, - effect::{Effect, Effective, EffectiveExt as _, ErasedEffective}, + any::OwnedStatic, + effect::{Effect, EffectiveExt as _, ErasedEffective}, never::Never, protocol::{visitor::visit_value, DynVisitor}, WalkerTypes, @@ -81,7 +81,7 @@ impl<'ctx, T: ?Sized + Send + Sync + 'static, E: Effect> crate::Walker<'ctx, E> #[inline(always)] fn walk<'b: 'c, 'c>( self, - visitor: DynVisitor<'b, 'ctx>, + _visitor: DynVisitor<'b, 'ctx>, ) -> ErasedEffective<'c, Result<Self::Output, Self::Error>, E> { // Attempt to visit using the value protocol. todo!() |