70
70
clippy:: checked_conversions,
71
71
) ]
72
72
73
- #[ cfg( feature = "internal-no-panic" ) ]
74
- use no_panic:: no_panic;
75
-
76
73
// silly way to test rust code blocks in README.md
77
74
// https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html
78
75
#[ doc = include_str ! ( "../README.md" ) ]
@@ -223,7 +220,6 @@ pub enum SampleFormat {
223
220
impl SampleFormat {
224
221
/// Returns the size of the decoded sample in bytes.
225
222
/// Custom formats always return 0.
226
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
227
223
pub fn decoded_size ( & self ) -> usize {
228
224
match & self {
229
225
SampleFormat :: U8 => 1 ,
@@ -242,7 +238,6 @@ impl SampleFormat {
242
238
243
239
/// Returns the size of the sample in the stream in bytes.
244
240
/// CompressedIma4 returns 0. Custom formats return 1 (they are assumed to write single bytes).
245
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
246
241
#[ inline( always) ]
247
242
fn encoded_size ( & self ) -> u64 {
248
243
match & self {
@@ -261,7 +256,6 @@ impl SampleFormat {
261
256
}
262
257
263
258
/// Calculates the sample count based on byte length and sample format.
264
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
265
259
fn calculate_sample_len ( & self , sample_byte_len : u32 ) -> Option < u64 > {
266
260
match self {
267
261
SampleFormat :: CompressedIma4 => {
@@ -277,7 +271,6 @@ impl SampleFormat {
277
271
}
278
272
279
273
/// The maximum channel count for the sample format.
280
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
281
274
fn maximum_channel_count ( & self ) -> i16 {
282
275
match self {
283
276
SampleFormat :: CompressedIma4 => 2 ,
@@ -287,7 +280,6 @@ impl SampleFormat {
287
280
288
281
/// Returns the COMM chunk's bits per sample value for the writer.
289
282
/// Compressed formats and custom formats return 0.
290
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
291
283
fn bits_per_sample ( & self ) -> u8 {
292
284
match & self {
293
285
SampleFormat :: U8 => 8 ,
@@ -341,7 +333,6 @@ struct CountingWrite<W> where W: Write {
341
333
}
342
334
343
335
impl < W : Write > CountingWrite < W > {
344
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
345
336
pub fn new ( handle : W ) -> CountingWrite < W > {
346
337
CountingWrite {
347
338
handle,
@@ -367,17 +358,14 @@ impl<W: Write> Write for CountingWrite<W> {
367
358
}
368
359
}
369
360
370
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
371
361
fn is_even_u32 ( value : u32 ) -> bool {
372
362
value & 1 == 0
373
363
}
374
364
375
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
376
365
fn is_even_u64 ( value : u64 ) -> bool {
377
366
value & 1 == 0
378
367
}
379
368
380
- #[ cfg_attr( feature = "internal-no-panic" , no_panic) ]
381
369
fn is_even_usize ( value : usize ) -> bool {
382
370
value & 1 == 0
383
371
}
0 commit comments