File tree 4 files changed +8
-14
lines changed
4 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use ruzstd::decoding::bit_reader_reverse::BitReaderReversed;
5
5
fn do_all_accesses ( br : & mut BitReaderReversed , accesses : & [ u8 ] ) -> u64 {
6
6
let mut sum = 0 ;
7
7
for x in accesses {
8
- sum += br. get_bits ( * x) . unwrap ( ) as u64 ;
8
+ sum += br. get_bits ( * x) . unwrap ( ) ;
9
9
}
10
10
let _ = black_box ( br) ;
11
11
sum
Original file line number Diff line number Diff line change @@ -268,8 +268,6 @@ impl RingBuffer {
268
268
/// 2. More then len reserved space so we do not write out-of-bounds
269
269
#[ warn( unsafe_op_in_unsafe_fn) ]
270
270
pub unsafe fn extend_from_within_unchecked ( & mut self , start : usize , len : usize ) {
271
- debug_assert ! ( !self . buf. as_ptr( ) . is_null( ) ) ;
272
-
273
271
if self . head < self . tail {
274
272
// continous data slice |____HDDDDDDDT_____|
275
273
let after_tail = usize:: min ( len, self . cap - self . tail ) ;
Original file line number Diff line number Diff line change @@ -17,12 +17,10 @@ fn test_all_artifacts() {
17
17
}
18
18
19
19
let mut f = File :: open ( file_name. clone ( ) ) . unwrap ( ) ;
20
- match frame_dec. reset ( & mut f) {
21
- Ok ( _) => {
22
- let _ = frame_dec. decode_blocks ( & mut f, frame_decoder:: BlockDecodingStrategy :: All ) ;
23
- /* ignore errors. It just should never panic on invalid input */
24
- }
25
- Err ( _) => { } /* ignore errors. It just should never panic on invalid input */
26
- }
20
+
21
+ /* ignore errors. It just should never panic on invalid input */
22
+ let _: Result < _ , _ > = frame_dec. reset ( & mut f) . and_then ( |( ) | {
23
+ frame_dec. decode_blocks ( & mut f, frame_decoder:: BlockDecodingStrategy :: All )
24
+ } ) ;
27
25
}
28
26
}
Original file line number Diff line number Diff line change @@ -351,8 +351,7 @@ fn test_streaming_no_std() {
351
351
let mut stream = crate :: streaming_decoder:: StreamingDecoder :: new ( & mut content) . unwrap ( ) ;
352
352
353
353
let original = include_bytes ! ( "../../decodecorpus_files/z000088" ) ;
354
- let mut result = Vec :: new ( ) ;
355
- result. resize ( original. len ( ) , 0 ) ;
354
+ let mut result = vec ! [ 0 ; original. len( ) ] ;
356
355
Read :: read_exact ( & mut stream, & mut result) . unwrap ( ) ;
357
356
358
357
if original. len ( ) != result. len ( ) {
@@ -391,8 +390,7 @@ fn test_streaming_no_std() {
391
390
. unwrap ( ) ;
392
391
393
392
let original = include_bytes ! ( "../../decodecorpus_files/z000068" ) ;
394
- let mut result = Vec :: new ( ) ;
395
- result. resize ( original. len ( ) , 0 ) ;
393
+ let mut result = vec ! [ 0 ; original. len( ) ] ;
396
394
Read :: read_exact ( & mut stream, & mut result) . unwrap ( ) ;
397
395
398
396
std:: println!( "Results for file:" ) ;
You can’t perform that action at this time.
0 commit comments