diff --git a/src/atomic.rs b/src/atomic.rs index e10ffa2..23a625a 100644 --- a/src/atomic.rs +++ b/src/atomic.rs @@ -56,7 +56,7 @@ pub trait Atomic: AtomicModeParse { fn a_extend(self, tail: &[u8]) -> AParseResult; } -fn _parse_slice(slice: &[u8]) -> AParseResult { +fn parse_slice(slice: &[u8]) -> AParseResult { let mut deserializer = SliceDeserializer::from(slice); let atomic = A::a_deserialize(&mut deserializer)?; let tail = deserializer.read_all(); @@ -73,7 +73,7 @@ pub trait AtomicExt: Atomic { /// /// [`FactoryExt::parse_slice`]: crate::rcore::FactoryExt::parse_slice fn parse_slice(slice: &[u8]) -> AParseResult { - _parse_slice(slice) + parse_slice(slice) } } diff --git a/src/flow/speculative.rs b/src/flow/speculative.rs index 4c727df..ea659cd 100644 --- a/src/flow/speculative.rs +++ b/src/flow/speculative.rs @@ -6,59 +6,59 @@ type Frwa<'a, A, E0, E1, Fallible> = type Wwa<'a, A, E0, E1, Fallible> = WrapE<'a, WrapE<'a, A, E0, Fallible>, E1, Fallible>; trait SpeculativeFailImpl<'a>: MonadFailAny<'a> { - fn _speculative_a_wb( + fn speculative_a_wb( a: A, wb: WrapE<'a, B, E0, Self>, ) -> WrapE<'a, (A, B), Result, Self> { Self::map_err( as Functor>::fmap(wb, |b| (a, b)), Ok) } - fn _speculative_ra_wb( + fn speculative_ra_wb( ra: Result, wb: WrapE<'a, B, E0, Self>, ) -> WrapE<'a, (A, B), Result, Self> { match ra { - Ok(a) => Self::_speculative_a_wb(a, wb), + Ok(a) => Self::speculative_a_wb(a, wb), Err(e0) => Self::fail(Ok(e0)), } } - fn _speculative_ra_rwb( + fn speculative_ra_rwb( ra: Result, rwb: Result, E1>, ) -> WrapE<'a, (A, B), Result, Self> { match rwb { - Ok(wb) => Self::_speculative_ra_wb(ra, wb), + Ok(wb) => Self::speculative_ra_wb(ra, wb), Err(e1) => Self::fail(Err(e1)), } } - fn _speculative_ra_frwb( + fn speculative_ra_frwb( ra: Result, frwb: Frwa<'a, B, E0, E1, Self>, ) -> WrapE<'a, (A, B), Result, Self> { Self::stuff(::bind(frwb, |rwb| { - Self::unstuff(Self::_speculative_ra_rwb(ra, rwb)) + Self::unstuff(Self::speculative_ra_rwb(ra, rwb)) })) } - fn _speculative_fra_wb( + fn speculative_fra_wb( fra: Wrap<'a, Result, Self::T>, wb: WrapE<'a, B, E0, Self>, ) -> WrapE<'a, (A, B), E0, Self> { as ApplicativeTuple>::tuple((Self::stuff(fra), wb)) } - fn _speculative_wa_frwb( + fn speculative_wa_frwb( wa: WrapE<'a, A, E0, Self>, frwb: Frwa<'a, B, E0, E1, Self>, ) -> WrapE<'a, (A, B), Result, Self> { Self::stuff(<::T as Monad>::join( <::T as Functor>::fmap( Self::T::select_map(Self::unstuff(wa), frwb, |selected| match selected { - Selected::A(ra, frwb) => Self::_speculative_ra_frwb(ra, frwb), + Selected::A(ra, frwb) => Self::speculative_ra_frwb(ra, frwb), Selected::B(fra, Ok(wb)) => { - Self::map_err(Self::_speculative_fra_wb(fra, wb), Ok) + Self::map_err(Self::speculative_fra_wb(fra, wb), Ok) } Selected::B(_, Err(e1)) => Self::fail(Err(e1)), }), @@ -67,17 +67,16 @@ trait SpeculativeFailImpl<'a>: MonadFailAny<'a> { )) } - fn _speculative_frwa_wb( + fn speculative_frwa_wb( frwa: Frwa<'a, A, E0, E1, Self>, wb: WrapE<'a, B, E0, Self>, ) -> WrapE<'a, (A, B), Result, Self> { - > as Functor>::fmap( - Self::_speculative_wa_frwb(wb, frwa), - |(b, a)| (a, b), - ) + > as Functor>::fmap(Self::speculative_wa_frwb(wb, frwa), |(b, a)| { + (a, b) + }) } - fn _speculative( + fn speculative_impl( wwa: Wwa<'a, A, E0, E1, Self>, wwb: Wwa<'a, B, E0, E1, Self>, ) -> WrapE<'a, (A, B), Result, Self> { @@ -86,9 +85,9 @@ trait SpeculativeFailImpl<'a>: MonadFailAny<'a> { Self::unstuff(wwa), Self::unstuff(wwb), |selected| match selected { - Selected::A(Ok(wa), frwb) => Self::_speculative_wa_frwb(wa, frwb), + Selected::A(Ok(wa), frwb) => Self::speculative_wa_frwb(wa, frwb), Selected::A(Err(e1), _) => Self::fail(Err(e1)), - Selected::B(frwa, Ok(wb)) => Self::_speculative_frwa_wb(frwa, wb), + Selected::B(frwa, Ok(wb)) => Self::speculative_frwa_wb(frwa, wb), Selected::B(_, Err(e1)) => Self::fail(Err(e1)), }, ), @@ -102,7 +101,7 @@ pub trait SpeculativeFail<'a>: MonadFailAny<'a> { wwa: Wwa<'a, A, E0, E1, Self>, wwb: Wwa<'a, B, E0, E1, Self>, ) -> WrapE<'a, (A, B), Result, Self> { - Self::_speculative(wwa, wwb) + Self::speculative_impl(wwa, wwb) } } diff --git a/src/func/derivations.rs b/src/func/derivations.rs index 1276e64..414d766 100644 --- a/src/func/derivations.rs +++ b/src/func/derivations.rs @@ -17,7 +17,7 @@ pub fn bind<'a, T: Monad<'a>, A: 'a + Send, B: 'a + Send>( } pub trait ApplicativeLA2ViaSeq<'a>: ApplicativeSeq<'a> { - fn _la2_via_seq( + fn la2_via_seq( f: impl 'a + Send + FnOnce(A, B) -> C, fa: Self::F, fb: Self::F, @@ -29,7 +29,7 @@ pub trait ApplicativeLA2ViaSeq<'a>: ApplicativeSeq<'a> { impl<'a, T: ApplicativeSeq<'a>> ApplicativeLA2ViaSeq<'a> for T {} pub trait ApplicativeSeqViaLA2<'a>: ApplicativeLA2<'a> { - fn _seq_via_la2( + fn seq_via_la2( ff: Self::F B>, fa: Self::F, ) -> Self::F { @@ -40,7 +40,7 @@ pub trait ApplicativeSeqViaLA2<'a>: ApplicativeLA2<'a> { impl<'a, T: ApplicativeLA2<'a>> ApplicativeSeqViaLA2<'a> for T {} pub trait ApplicativeTupleViaLA2<'a>: ApplicativeLA2<'a> { - fn _tuple_via_la2( + fn tuple_via_la2( (fa, fb): (Self::F, Self::F), ) -> Self::F<(A, B)> { Self::la2(fa, fb, |a, b| (a, b)) diff --git a/src/func/instances/stackless.rs b/src/func/instances/stackless.rs index 76fb4a7..6321667 100644 --- a/src/func/instances/stackless.rs +++ b/src/func/instances/stackless.rs @@ -59,7 +59,7 @@ impl Atom for Temp { } impl<'a> EvalTree<'a> { - fn _next_composite(mut self: Box, other: Box) -> Self { + fn next_composite(mut self: Box, other: Box) -> Self { match *self { Self::Atom(f) => match f.next() { Some(newleft) => { @@ -78,7 +78,7 @@ impl<'a> EvalTree<'a> { fn next(self) -> Oet<'a> { match self { Self::Atom(f) => f.next(), - Self::Composite(etl, etr) => Some(etl._next_composite(etr)), + Self::Composite(etl, etr) => Some(etl.next_composite(etr)), } } } @@ -239,13 +239,13 @@ impl<'a> ApplicativeLA2<'a> for StacklessInstance { fb: Self::F, f: impl 'a + Send + FnOnce(A, B) -> C, ) -> Self::F { - Self::_la2_via_seq(f, fa, fb) + Self::la2_via_seq(f, fa, fb) } } impl<'a> ApplicativeTuple<'a> for StacklessInstance { fn tuple((fa, fb): (Self::F, Self::F)) -> Self::F<(A, B)> { - Self::_tuple_via_la2((fa, fb)) + Self::tuple_via_la2((fa, fb)) } } diff --git a/src/rcore/addresses.rs b/src/rcore/addresses.rs index 0ce3e4e..0db6f16 100644 --- a/src/rcore/addresses.rs +++ b/src/rcore/addresses.rs @@ -58,7 +58,7 @@ pub(super) trait InliningAddresses: Stream { impl InliningAddresses for D {} -fn _parse_slice<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>>( +fn parse_slice<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>>( factory: &F, slice: &[u8], resolver: &Arc>, @@ -83,7 +83,7 @@ impl<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>> FactoryExt<'a, Ctx> for F { slice: &[u8], resolver: &Arc>, ) -> ParseResult<'a, Self> { - _parse_slice::(self, slice, resolver) + parse_slice::(self, slice, resolver) } } diff --git a/src/rcore/resolver_origin.rs b/src/rcore/resolver_origin.rs index fecbb65..46819a4 100644 --- a/src/rcore/resolver_origin.rs +++ b/src/rcore/resolver_origin.rs @@ -24,7 +24,7 @@ struct ResolverOrigin<'a, Ctx: Context<'a>, F: FactoryBase<'a>> { r_resolver: Arc>, } -fn _resolve_origin<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>>( +fn resolve_origin<'a, Ctx: Context<'a>, F: FactoryParse<'a, Ctx>>( origin: Arc>, ) -> Resolution<'a, Ctx, F::Mtbl> { origin @@ -51,7 +51,7 @@ impl<'a, Ctx: Context<'a>, F: FactoryBase<'a>> Origin<'a, Ctx> for ResolverOrigi where F: FactoryParse<'a, Ctx>, { - _resolve_origin(self) + resolve_origin(self) } fn resolve_bytes(self: Arc) -> HashResolution<'a, Ctx> { diff --git a/src/rstd/cast.rs b/src/rstd/cast.rs index a8959c4..9b01001 100644 --- a/src/rstd/cast.rs +++ b/src/rstd/cast.rs @@ -87,7 +87,7 @@ impl<'a, Ctx: CastCtx<'a>> CastResolver<'a, Ctx> { Arc::new(Self { points }) } - fn _get_point( + fn get_point_impl( &self, index: usize, ) -> Result<&Point<'a, Ctx, TypelessMentionable<'a, Ctx>>, CastError<'a>> { @@ -100,7 +100,7 @@ impl<'a, Ctx: CastCtx<'a>> CastResolver<'a, Ctx> { } } - fn _validate_point( + fn validate_point( &self, point: &Point<'a, Ctx, TypelessMentionable<'a, Ctx>>, address: Address, @@ -120,8 +120,8 @@ impl<'a, Ctx: CastCtx<'a>> CastResolver<'a, Ctx> { &self, address: Address, ) -> Result<&Point<'a, Ctx, TypelessMentionable<'a, Ctx>>, CastError<'a>> { - let point = self._get_point(address.index)?; - self._validate_point(point, address)?; + let point = self.get_point_impl(address.index)?; + self.validate_point(point, address)?; Ok(point) } } diff --git a/src/rstd/inlining.rs b/src/rstd/inlining.rs index 79c7d6e..190237a 100644 --- a/src/rstd/inlining.rs +++ b/src/rstd/inlining.rs @@ -178,30 +178,30 @@ impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx> + FixedSizeObject<'a, Ctx>> /// whether some other type (for example, a generic parameter type) /// is fixed-size or not. pub trait AlwaysFixedSize { - fn _size(&self) -> usize; + fn asize(&self) -> usize; } impl<'a, Ctx: Context<'a>, F: AlwaysFixedSize + InliningFactory<'a, Ctx>> FixedSizeFactory<'a, Ctx> for F { fn size(&self) -> usize { - self._size() + self.asize() } } /// Compile-time analogue of [`AlwaysFixedSize`]. pub trait AlwaysConstSize { - const _SIZE: usize; + const ASIZE: usize; } impl AlwaysFixedSize for F { - fn _size(&self) -> usize { - Self::_SIZE + fn asize(&self) -> usize { + Self::ASIZE } } impl<'a, Ctx: Context<'a>, F: AlwaysConstSize + InliningFactory<'a, Ctx>> ConstSizeFactory<'a, Ctx> for F { - const SIZE: usize = Self::_SIZE; + const SIZE: usize = Self::ASIZE; } diff --git a/src/rstd/nullable.rs b/src/rstd/nullable.rs index 185f21e..084dfb5 100644 --- a/src/rstd/nullable.rs +++ b/src/rstd/nullable.rs @@ -147,7 +147,7 @@ impl<'a, Ctx: Context<'a>, F: FactoryBase<'a>> CInliningFactory<'a, Ctx> } impl AlwaysConstSize for NullableFactory { - const _SIZE: usize = HASH_SIZE; + const ASIZE: usize = HASH_SIZE; } impl<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>> From> for Nullable<'a, Ctx, A> { diff --git a/src/rstd/point.rs b/src/rstd/point.rs index 25705cd..4fd974e 100644 --- a/src/rstd/point.rs +++ b/src/rstd/point.rs @@ -107,5 +107,5 @@ impl<'a, Ctx: Context<'a>, F: FactoryBase<'a>> CInliningFactory<'a, Ctx> for Poi } impl AlwaysConstSize for PointFactory { - const _SIZE: usize = HASH_SIZE; + const ASIZE: usize = HASH_SIZE; }