File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
55This project adheres to [ Semantic Versioning] ( https://semver.org ) .
66
7+ ## [ 1.1.2] - 2025-10-02
8+
9+ Simplify ` Buf::chunks_vectored ` implementations for ` BufList ` and ` Cursor<T> ` .
10+
711## [ 1.1.1] - 2025-10-01
812
913### Added
@@ -74,6 +78,7 @@ This project adheres to [Semantic Versioning](https://semver.org).
7478
7579- Initial release.
7680
81+ [ 1.1.2 ] : https://github.com/sunshowers-code/buf-list/releases/tag/1.1.2
7782[ 1.1.1 ] : https://github.com/sunshowers-code/buf-list/releases/tag/1.1.1
7883[ 1.1.0 ] : https://github.com/sunshowers-code/buf-list/releases/tag/1.1.0
7984[ 1.0.3 ] : https://github.com/sunshowers-code/buf-list/releases/tag/1.0.3
Original file line number Diff line number Diff line change @@ -231,9 +231,8 @@ impl<T: AsRef<BufList>> Buf for Cursor<T> {
231231 let to_fill = ( iovs. len ( ) ) . min ( list. num_chunks ( ) - current_chunk) ;
232232 for ( i, iov) in iovs. iter_mut ( ) . enumerate ( ) . take ( to_fill) . skip ( 1 ) {
233233 * iov = IoSlice :: new (
234- & list
235- . get_chunk ( current_chunk + i)
236- . expect ( "chunk is in range" ) [ ..] ,
234+ list. get_chunk ( current_chunk + i)
235+ . expect ( "chunk is in range" ) ,
237236 ) ;
238237 }
239238
Original file line number Diff line number Diff line change @@ -217,17 +217,12 @@ impl Buf for BufList {
217217 return 0 ;
218218 }
219219
220- // Loop over the buffers in the replay buffer list, and try to fill as
221- // many iovecs as we can from each buffer.
222- let mut filled = 0 ;
223- for buf in & self . bufs {
224- filled += buf. chunks_vectored ( & mut iovs[ filled..] ) ;
225- if filled == iovs. len ( ) {
226- return filled;
227- }
220+ let to_fill = ( iovs. len ( ) ) . min ( self . bufs . len ( ) ) ;
221+ for ( i, iov) in iovs. iter_mut ( ) . enumerate ( ) . take ( to_fill) {
222+ * iov = IoSlice :: new ( & self . bufs [ i] ) ;
228223 }
229224
230- filled
225+ to_fill
231226 }
232227
233228 fn advance ( & mut self , mut amt : usize ) {
You can’t perform that action at this time.
0 commit comments