1# 1.9.0 (November 27, 2024)
2
3### Added
4
5- Add `Bytes::from_owner` to enable externally-allocated memory (#742)
6
7### Documented
8
9- Fix typo in Buf::chunk() comment (#744)
10
11### Internal changes
12
13- Replace BufMut::put with BufMut::put_slice in Writer impl (#745)
14- Rename hex_impl! to fmt_impl! and reuse it for fmt::Debug (#743)
15
16# 1.8.0 (October 21, 2024)
17
18- Guarantee address in `split_off`/`split_to` for empty slices (#740)
19
20# 1.7.2 (September 17, 2024)
21
22### Fixed
23
24- Fix default impl of `Buf::{get_int, get_int_le}` (#732)
25
26### Documented
27
28- Fix double spaces in comments and doc comments (#731)
29
30### Internal changes
31
32- Ensure BytesMut::advance reduces capacity (#728)
33
34# 1.7.1 (August 1, 2024)
35
36This release reverts the following change due to a regression:
37
38- Reuse capacity when possible in `<BytesMut as Buf>::advance` impl (#698)
39
40The revert can be found at #726.
41
42# 1.7.0 (July 31, 2024)
43
44### Added
45
46- Add conversion from `Bytes` to `BytesMut` (#695, #710)
47- Add reclaim method without additional allocation (#686)
48
49### Documented
50
51- Clarify how `BytesMut::zeroed` works (#714)
52- Clarify the behavior of `Buf::chunk` (#717)
53
54### Changed
55
56- Change length condition of `BytesMut::truncate`
57- Reuse capacity when possible in `<BytesMut as Buf>::advance` impl (#698)
58- Improve `must_use` suggestion of `BytesMut::split` (#699)
59
60### Internal changes
61
62- Use `ManuallyDrop` instead of `mem::forget` (#678)
63- Don't set `len` in `BytesMut::reserve` (#682)
64- Optimize `Bytes::copy_to_bytes` (#688)
65- Refactor `BytesMut::truncate` (#694)
66- Refactor `BytesMut::resize` (#696)
67- Reorder assertion in `Bytes::split_to`, `Bytes::split_off` (#689, #693)
68- Use `offset_from` in more places (#705)
69- Correct the wrong usage of `IntoIter` (#707)
70
71# 1.6.1 (July 13, 2024)
72
73This release fixes a bug where `Bytes::is_unique` returns incorrect values when
74the `Bytes` originates from a shared `BytesMut`. (#718)
75
76# 1.6.0 (March 22, 2024)
77
78### Added
79
80- Add `Bytes::is_unique` (#643)
81
82### Documented
83
84- Fix changelog typo (#628)
85- Fix some spelling mistakes (#633)
86- Typo fix (#637)
87- Fix broken links (#639)
88- Add security policy (#649)
89
90### Internal changes
91
92- Move comment to correct constant (#629)
93- Various cleanup (#635)
94- Simplify `UninitSlice::as_uninit_slice_mut()` logic (#644)
95- Use `self.` instead of `Self::` (#642)
96- `BytesMut`: Assert alignment of `Shared` (#652)
97- Remove unnecessary namespace qualifier (#660)
98- Remove an unnecessary else branch (#662)
99- Remove unreachable else branch (#661)
100- make parameter mut in `From<Vec>` (#667)
101- Restore commented tests (#665)
102- Use `sub` instead of `offset` (#668)
103- Calculate original capacity only if necessary (#666)
104- `set_vec_pos` does not need a second parameter (#672)
105- `get_vec_pos`: use `&self` instead of `&mut self` (#670)
106- Refactor `split_at`/`split_to` (#663)
107- Use `Iterator` from the prelude (#673)
108- `copy_to_bytes`: Add panic section to docs (#676)
109- Remove redundant reserve call (#674)
110- Use `ManuallyDrop` instead of `mem::forget` (#675)
111
112
113# 1.5.0 (September 7, 2023)
114
115### Added
116
117- Add `UninitSlice::{new,uninit}` (#598, #599)
118- Implement `BufMut` for `&mut [MaybeUninit<u8>]` (#597)
119
120### Changed
121
122- Mark `BytesMut::extend_from_slice` as inline (#595)
123
124# 1.4.0 (January 31, 2023)
125
126### Added
127
128- Make `IntoIter` constructor public (#581)
129
130### Fixed
131
132- Avoid large reallocations when freezing `BytesMut` (#592)
133
134### Documented
135
136- Document which functions require `std` (#591)
137- Fix duplicate "the the" typos (#585)
138
139# 1.3.0 (November 20, 2022)
140
141### Added
142
143- Rename and expose `BytesMut::spare_capacity_mut` (#572)
144- Implement native-endian get and put functions for `Buf` and `BufMut` (#576)
145
146### Fixed
147
148- Don't have important data in unused capacity when calling reserve (#563)
149
150### Documented
151
152- `Bytes::new` etc should return `Self` not `Bytes` (#568)
153
154# 1.2.1 (July 30, 2022)
155
156### Fixed
157
158- Fix unbounded memory growth when using `reserve` (#560)
159
160# 1.2.0 (July 19, 2022)
161
162### Added
163
164- Add `BytesMut::zeroed` (#517)
165- Implement `Extend<Bytes>` for `BytesMut` (#527)
166- Add conversion from `BytesMut` to `Vec<u8>` (#543, #554)
167- Add conversion from `Bytes` to `Vec<u8>` (#547)
168- Add `UninitSlice::as_uninit_slice_mut()` (#548)
169- Add const to `Bytes::{len,is_empty}` (#514)
170
171### Changed
172
173- Reuse vector in `BytesMut::reserve` (#539, #544)
174
175### Fixed
176
177- Make miri happy (#515, #523, #542, #545, #553)
178- Make tsan happy (#541)
179- Fix `remaining_mut()` on chain (#488)
180- Fix amortized asymptotics of `BytesMut` (#555)
181
182### Documented
183
184- Redraw layout diagram with box drawing characters (#539)
185- Clarify `BytesMut::unsplit` docs (#535)
186
187# 1.1.0 (August 25, 2021)
188
189### Added
190
191- `BufMut::put_bytes(self, val, cnt)` (#487)
192- Implement `From<Box<[u8]>>` for `Bytes` (#504)
193
194### Changed
195
196- Override `put_slice` for `&mut [u8]` (#483)
197- Panic on integer overflow in `Chain::remaining` (#482)
198- Add inline tags to `UninitSlice` methods (#443)
199- Override `copy_to_bytes` for Chain and Take (#481)
200- Keep capacity when unsplit on empty other buf (#502)
201
202### Documented
203
204- Clarify `BufMut` allocation guarantees (#501)
205- Clarify `BufMut::put_int` behavior (#486)
206- Clarify actions of `clear` and `truncate`. (#508)
207
208# 1.0.1 (January 11, 2021)
209
210### Changed
211- mark `Vec::put_slice` with `#[inline]` (#459)
212
213### Fixed
214- Fix deprecation warning (#457)
215- use `Box::into_raw` instead of `mem::forget`-in-disguise (#458)
216
217# 1.0.0 (December 22, 2020)
218
219### Changed
220- Rename `Buf`/`BufMut` methods `bytes()` and `bytes_mut()` to `chunk()` and `chunk_mut()` (#450)
221
222### Removed
223- remove unused Buf implementation. (#449)
224
225# 0.6.0 (October 21, 2020)
226
227API polish in preparation for a 1.0 release.
228
229### Changed
230- `BufMut` is now an `unsafe` trait (#432).
231- `BufMut::bytes_mut()` returns `&mut UninitSlice`, a type owned by `bytes` to
232  avoid undefined behavior (#433).
233- `Buf::copy_to_bytes(len)` replaces `Buf::into_bytes()` (#439).
234- `Buf`/`BufMut` utility methods are moved onto the trait and `*Ext` traits are
235  removed (#431).
236
237### Removed
238- `BufMut::bytes_vectored_mut()` (#430).
239- `new` methods on combinator types (#434).
240
241# 0.5.6 (July 13, 2020)
242
243- Improve `BytesMut` to reuse buffer when fully `advance`d.
244- Mark `BytesMut::{as_mut, set_len}` with `#[inline]`.
245- Relax synchronization when cloning in shared vtable of `Bytes`.
246- Move `loom` to `dev-dependencies`.
247
248# 0.5.5 (June 18, 2020)
249
250### Added
251- Allow using the `serde` feature in `no_std` environments (#385).
252
253### Fix
254- Fix `BufMut::advance_mut` to panic if advanced passed the capacity (#354)..
255- Fix `BytesMut::freeze` ignoring amount previously `advance`d (#352).
256
257# 0.5.4 (January 23, 2020)
258
259### Added
260- Make `Bytes::new` a `const fn`.
261- Add `From<BytesMut>` for `Bytes`.
262
263### Fix
264- Fix reversed arguments in `PartialOrd` for `Bytes`.
265- Fix `Bytes::truncate` losing original capacity when repr is an unshared `Vec`.
266- Fix `Bytes::from(Vec)` when allocator gave `Vec` a pointer with LSB set.
267- Fix panic in `Bytes::slice_ref` if argument is an empty slice.
268
269# 0.5.3 (December 12, 2019)
270
271### Added
272- `must_use` attributes to `split`, `split_off`, and `split_to` methods (#337).
273
274### Fix
275- Potential freeing of a null pointer in `Bytes` when constructed with an empty `Vec<u8>` (#341, #342).
276- Calling `Bytes::truncate` with a size large than the length will no longer clear the `Bytes` (#333).
277
278# 0.5.2 (November 27, 2019)
279
280### Added
281- `Limit` methods `into_inner`, `get_ref`, `get_mut`, `limit`, and `set_limit` (#325).
282
283# 0.5.1 (November 25, 2019)
284
285### Fix
286- Growth documentation for `BytesMut` (#321)
287
288# 0.5.0 (November 25, 2019)
289
290### Fix
291- Potential overflow in `copy_to_slice`
292
293### Changed
294- Increased minimum supported Rust version to 1.39.
295- `Bytes` is now a "trait object", allowing for custom allocation strategies (#298)
296- `BytesMut` implicitly grows internal storage. `remaining_mut()` returns
297  `usize::MAX` (#316).
298- `BufMut::bytes_mut` returns `&mut [MaybeUninit<u8>]` to reflect the unknown
299  initialization state (#305).
300- `Buf` / `BufMut` implementations for `&[u8]` and `&mut [u8]`
301  respectively (#261).
302- Move `Buf` / `BufMut` "extra" functions to an extension trait (#306).
303- `BufMutExt::limit` (#309).
304- `Bytes::slice` takes a `RangeBounds` argument (#265).
305- `Bytes::from_static` is now a `const fn` (#311).
306- A multitude of smaller performance optimizations.
307
308### Added
309- `no_std` support (#281).
310- `get_*`, `put_*`, `get_*_le`, and `put_*le` accessors for handling byte order.
311- `BorrowMut` implementation for `BytesMut` (#185).
312
313### Removed
314- `IntoBuf` (#288).
315- `Buf` implementation for `&str` (#301).
316- `byteorder` dependency (#280).
317- `iovec` dependency, use `std::IoSlice` instead (#263).
318- optional `either` dependency (#315).
319- optional `i128` feature -- now available on stable. (#276).
320
321# 0.4.12 (March 6, 2019)
322
323### Added
324- Implement `FromIterator<&'a u8>` for `BytesMut`/`Bytes` (#244).
325- Implement `Buf` for `VecDeque` (#249).
326
327# 0.4.11 (November 17, 2018)
328
329* Use raw pointers for potentially racy loads (#233).
330* Implement `BufRead` for `buf::Reader` (#232).
331* Documentation tweaks (#234).
332
333# 0.4.10 (September 4, 2018)
334
335* impl `Buf` and `BufMut` for `Either` (#225).
336* Add `Bytes::slice_ref` (#208).
337
338# 0.4.9 (July 12, 2018)
339
340* Add 128 bit number support behind a feature flag (#209).
341* Implement `IntoBuf` for `&mut [u8]`
342
343# 0.4.8 (May 25, 2018)
344
345* Fix panic in `BytesMut` `FromIterator` implementation.
346* Bytes: Recycle space when reserving space in vec mode (#197).
347* Bytes: Add resize fn (#203).
348
349# 0.4.7 (April 27, 2018)
350
351* Make `Buf` and `BufMut` usable as trait objects (#186).
352* impl BorrowMut for BytesMut (#185).
353* Improve accessor performance (#195).
354
355# 0.4.6 (Janary 8, 2018)
356
357* Implement FromIterator for Bytes/BytesMut (#148).
358* Add `advance` fn to Bytes/BytesMut (#166).
359* Add `unsplit` fn to `BytesMut` (#162, #173).
360* Improvements to Bytes split fns (#92).
361
362# 0.4.5 (August 12, 2017)
363
364* Fix range bug in `Take::bytes`
365* Misc performance improvements
366* Add extra `PartialEq` implementations.
367* Add `Bytes::with_capacity`
368* Implement `AsMut[u8]` for `BytesMut`
369
370# 0.4.4 (May 26, 2017)
371
372* Add serde support behind feature flag
373* Add `extend_from_slice` on `Bytes` and `BytesMut`
374* Add `truncate` and `clear` on `Bytes`
375* Misc additional std trait implementations
376* Misc performance improvements
377
378# 0.4.3 (April 30, 2017)
379
380* Fix Vec::advance_mut bug
381* Bump minimum Rust version to 1.15
382* Misc performance tweaks
383
384# 0.4.2 (April 5, 2017)
385
386* Misc performance tweaks
387* Improved `Debug` implementation for `Bytes`
388* Avoid some incorrect assert panics
389
390# 0.4.1 (March 15, 2017)
391
392* Expose `buf` module and have most types available from there vs. root.
393* Implement `IntoBuf` for `T: Buf`.
394* Add `FromBuf` and `Buf::collect`.
395* Add iterator adapter for `Buf`.
396* Add scatter/gather support to `Buf` and `BufMut`.
397* Add `Buf::chain`.
398* Reduce allocations on repeated calls to `BytesMut::reserve`.
399* Implement `Debug` for more types.
400* Remove `Source` in favor of `IntoBuf`.
401* Implement `Extend` for `BytesMut`.
402
403
404# 0.4.0 (February 24, 2017)
405
406* Initial release
407