@@ -93,6 +93,7 @@ impl SendBufferData {
9393 /// Returns data which is associated with a range
9494 ///
9595 /// Requesting a range outside of the buffered data will panic.
96+ #[ cfg( any( test, feature = "bench" ) ) ]
9697 fn get ( & self , offsets : Range < u64 > ) -> & [ u8 ] {
9798 assert ! (
9899 offsets. start >= self . range( ) . start && offsets. end <= self . range( ) . end,
@@ -244,6 +245,7 @@ impl SendBuffer {
244245 /// in noncontiguous fashion in the send buffer. In this case callers
245246 /// should call the function again with an incremented start offset to
246247 /// retrieve more data.
248+ #[ cfg( any( test, feature = "bench" ) ) ]
247249 pub ( super ) fn get ( & self , offsets : Range < u64 > ) -> & [ u8 ] {
248250 self . data . get ( offsets)
249251 }
@@ -504,7 +506,7 @@ mod tests {
504506#[ cfg( feature = "bench" ) ]
505507pub mod send_buffer {
506508 //! Bench fns for SendBuffer
507- //!
509+ //!
508510 //! These are defined here and re-exported via `bench_exports` in lib.rs,
509511 //! so we can access the private `SendBuffer` struct.
510512 use bencher:: Bencher ;
@@ -529,7 +531,7 @@ pub mod send_buffer {
529531 bench. iter ( || {
530532 // Get from end (very slow - scans through all 1000 segments)
531533 tgt. clear ( ) ;
532- buf. get_into ( BYTES - PACKET_SIZE ..BYTES , bencher:: black_box ( & mut tgt) ) ;
534+ buf. get_into ( BYTES - PACKET_SIZE ..BYTES , bencher:: black_box ( & mut tgt) ) ;
533535 } ) ;
534536 }
535537
0 commit comments