diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d65933181..6489e76f75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [v0.9.2] 2025-11-12 +- Added `from_bytes_truncating_at_nul` to `CString` +- Added missing `?Sized` bounds in `PartialEq` implementations +- Make `PartialEq` implementation for `DequeInner` and `HistoryBufInner` generic over the storage of the RHS + +## [v0.9.2] 2025-11-12 + - Minor fixes to module docs. - Make MSRV of 1.87.0 explicit. - Implement `Default` for `CapacityError`. diff --git a/src/deque.rs b/src/deque.rs index 340f3ae182..fe51ac5487 100644 --- a/src/deque.rs +++ b/src/deque.rs @@ -1164,9 +1164,13 @@ where } } -impl PartialEq for Deque { - fn eq(&self, other: &Self) -> bool { - if self.len() != other.len() { +impl PartialEq> for DequeInner +where + S1: VecStorage + ?Sized, + S2: VecStorage + ?Sized, +{ + fn eq(&self, other: &DequeInner) -> bool { + if self.storage_len() != other.storage_len() { return false; } let (sa, sb) = self.as_slices(); diff --git a/src/history_buf.rs b/src/history_buf.rs index 8a15146f7d..a5194dfa3f 100644 --- a/src/history_buf.rs +++ b/src/history_buf.rs @@ -610,11 +610,13 @@ impl Default for HistoryBuf { } } -impl + ?Sized> PartialEq for HistoryBufInner +impl PartialEq> for HistoryBufInner where T: PartialEq, + S1: HistoryBufStorage + ?Sized, + S2: HistoryBufStorage + ?Sized, { - fn eq(&self, other: &Self) -> bool { + fn eq(&self, other: &HistoryBufInner) -> bool { self.oldest_ordered().eq(other.oldest_ordered()) } } diff --git a/src/vec/mod.rs b/src/vec/mod.rs index 448b22db34..093bdb13d2 100644 --- a/src/vec/mod.rs +++ b/src/vec/mod.rs @@ -1609,7 +1609,7 @@ impl PartialEq> for [A; where A: PartialEq, LenTB: LenType, - SB: VecStorage, + SB: VecStorage + ?Sized, { fn eq(&self, other: &VecInner) -> bool { self.eq(other.as_slice()) @@ -1620,7 +1620,7 @@ impl PartialEq> for &[A; where A: PartialEq, LenTB: LenType, - SB: VecStorage, + SB: VecStorage + ?Sized, { fn eq(&self, other: &VecInner) -> bool { (*self).eq(other) @@ -1631,7 +1631,7 @@ impl PartialEq> for [A] where A: PartialEq, LenTB: LenType, - SB: VecStorage, + SB: VecStorage + ?Sized, { fn eq(&self, other: &VecInner) -> bool { self.eq(other.as_slice()) @@ -1642,7 +1642,7 @@ impl PartialEq> for &[A] where A: PartialEq, LenTB: LenType, - SB: VecStorage, + SB: VecStorage + ?Sized, { fn eq(&self, other: &VecInner) -> bool { (*self).eq(other)