Skip to content

Commit f2109cd

Browse files
committed
Update changelog to latest
1 parent 0273fd8 commit f2109cd

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1+
## 0.9.0 - 2026-02-09
2+
3+
Remove `BitReader::remainder` as it artificially shortened the lifetime of the underlying data. Instead `LittleEndianReader::remainder` and `BigEndianReader::remainder` have been exposed and tie the remainder lifetime to the original data.
4+
5+
For those interested in the old behavior or want a trait that can be tied to the lifetime of the data:
6+
7+
```rust
8+
use bitter::{BigEndianReader, LittleEndianReader, Remainder};
9+
10+
// Old behavior:
11+
pub trait BitReaderRemainder {
12+
fn remainder(&self) -> Remainder<'_>;
13+
}
14+
15+
impl BitReaderRemainder for LittleEndianReader<'_> {
16+
#[inline]
17+
fn remainder(&self) -> Remainder<'_> {
18+
self.remainder()
19+
}
20+
}
21+
22+
impl BitReaderRemainder for BigEndianReader<'_> {
23+
#[inline]
24+
fn remainder(&self) -> Remainder<'_> {
25+
self.remainder()
26+
}
27+
}
28+
29+
// Abstraction trait for lifetime-awareness:
30+
pub trait BitReaderSlice<'a> {
31+
fn remainder(&self) -> Remainder<'a>;
32+
}
33+
34+
impl<'a> BitReaderSlice<'a> for LittleEndianReader<'a> {
35+
#[inline]
36+
fn remainder(&self) -> Remainder<'a> {
37+
self.remainder()
38+
}
39+
}
40+
41+
impl<'a> BitReaderSlice<'a> for BigEndianReader<'a> {
42+
#[inline]
43+
fn remainder(&self) -> Remainder<'a> {
44+
self.remainder()
45+
}
46+
}
47+
```
48+
149
## 0.8.1 - 2025-09-26
250

351
- Large performance improvement to unaligned `write_bytes`

0 commit comments

Comments
 (0)