Releases: WanderLanz/Lender
Release list
0.8.0
[0.8.0] - 2026-07-10
Changed
-
MaybeDanglingdoes not need anymore to implementDebug. -
peek_mutis now unsafe, as it could lead to UB.
Fixed
-
Peekable/Flattendrop order and leaks have been fixed. -
StepBywas misstepping by one on a fresh iterator. -
FusedLender/FallibleFusedLenderwere not implementing correctlylast. -
TakeWhilewas no honoring the fused contract. -
Takebackward advancing methods were not behaving correctly when
taking zero elements or advancing by zero elements. -
Chunkydoes not panic anymore on an advancing operation that
exhaust the underlying lender. -
from_iter_refnow drops the held element before getting the next one.
0.7.0
[0.7.0] - 2026-05-31
New
-
Functions
__check_lender_covariance,__check_fallible_lender_covariance,
__check_lending_covarianceand__check_fallible_lending_covarianceto
check covariance of lenders and lends in custom implementations. -
Many sources and accessors are now
const fn, so they can be used in
constcontexts (e.g.,from_iter,from_into_iter,from_iter_ref,
from_fn,once_with,windows_mut, andarray_windows_mut).
Fixed
-
find_mapimplementations were missing covariance checks. -
Removed spurious
&'shortreference from fallible covariance checks.
Changed
-
Following
std's policy, we have#[inline]on all public methods. -
We have now
resolver = 3, which should solve some update issues
with themaybe-danglingcrate.
0.6.2
0.6.1
0.6.0
Change Log
[0.6.0] - 2026-02-17
New
-
Major improvement to the covariance check: it is no longer possible to
circumvent it usingcore::ptr::null(),todo!(),unimplemented!(),
panic!(),loop {}, etc. -
Convenience
Lender::lender_by_refmethod that is equivalent to
iterfollowed byinto_ref_lender.
Fixed
FilterMap,Scan, andMapWhile(both standard and fallible) had an
additional parameter that was forcing a'staticbound when extending the
trait. Now they are structured likeMap.
0.5.2
[0.5.2] - 2026-02-15
New
- Convenience
Lender::lender_by_refmethod that is equivalent to
iterfollowed byinto_ref_lender.
Fixed
FilterMap,Scan, andMapWhile(both standard and fallible) had an
additional parameter that was forcing a'staticbound when extending the
trait. Now they are structured likeMap.
0.5.1
0.5.0
[0.5.0] - 2026-02-10
New
-
New infrastructure to check covariance of lends. Every implementation must
use either the (safe)check_covariance!/check_covariance_fallible!macros
(for sources) to check covariance of the lend lifetime, or the (unsafe)
unsafe_assume_covariance!/unsafe_assume_covariance_fallible!macros when
assuming covariance of underlying lends (without any check). Methods that used
to takefor<'all> Lending<'all>now takeCovariantLending, which depends
onfor<'all> Lending<'all, L>but forces a covariance check. -
Covariance checks have also been embedded in the
covar!,covar_mut!and
covar_oncemacros (formerlyhrc...), which are now required to pass a
closure, as closures are passed through theCovarwrapper, which forces
a covariance check. This unfortunately includes closures without lifetimes. -
Added missing
FromFallibleLender/ExtendFallibleLendertraits. -
The
Convertadapter is now accessible through theLender::convertmethod.
Improved
-
windows_mutis now double-ended. -
Fallible lenders have now feature parity with normal lenders. In particular,
FallibleLenderhas nowchunkandrpositionmethods. -
Thanks to
AliasableBoxandMaybeDanglingwe now pass miri. -
FallibleLender::advance_by/FallibleLender::advance_back_byhave now a
signature aligned withLender::advance_by/Lender::advance_back_by. -
Completed implementation of standard traits (
Debug,Clone,Default, etc.)
where possible.
Changed
-
Macros
hrc,hrc_mutandhrc_oncehave been renamed tocovar,covar_mut
andcovar_once, respectively. -
Windows and array windows must have a non-zero length, as in
Iterator,
and they implementFusedLenderandExactSizeLender. -
The return type of
Peekable::peekis nowOption<&'_ Lend<'_, L>>, which
fixes a problem of data escape. Analogously forFalliblePeekable::peek. -
The
lend!macro now covers just a set of fixed covariant types. If you need
to use more complex types, you can use thecovariant_lend!macro, which
however requires that you define a type name (with an optional
visibility specifier), as it cannot be inlined. The same applies to
fallible_lend!andcovariant_fallible_lend!. -
Coherent use of
must_useattribute. -
Fallible sources and adapters are now uniformly in separate modules with the
same name of the standard ones and are renamed inmod.rs. -
Fallible
once,repeat, etc. now follow thefallible_iteratordesign,
with specific methods likeonce_err,repeat_err, etc. to generate
errors. -
FallibleFusedLenderguaranteesOk(None)to repeat, but does not
have anymore a guarantee of behavior after an error (like it
happens withfallible_iterator). -
min/maxnow requireOrd, like the standardIteratormethods. -
IntoFalliblenow usesInfallibleas fixed error type, like
fallible_iterator.
Fixed
-
Several possible UBs are no longer possible thanks to the new covariance
checking infrastructure. -
PeekableandFalliblePeekableare now deallocating their fields
in the correct order. -
All implementations propagate correctly fused, double-ended and exact-size
traits. -
max/max_byreturn the last instance in case of ties, as inIterator
(previously they returned the first instance). -
All repeat method return
(usize::MAX, None)onsize_hint, as inIterator,
if they return a value, or(0, Some(0))if they return an error. -
The order of parameters (lend/error) in a few methods was inconsistent.
-
Removed
Cloneimplementation that could lead to UB fromPeekableand
FlattenCompat.