Skip to content

Commit 9f7987c

Browse files
committed
Fix linting issues and small mistakes
1 parent 26ebd2f commit 9f7987c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl ErrorCode {
6565
/// Return the human-readable description for this error.
6666
pub fn description(&self) -> &'static str {
6767
match self {
68-
ErrorCode::Unknown => "Unkown error.",
68+
ErrorCode::Unknown => "Unknown error.",
6969
_ => unsafe {
7070
CStr::from_ptr(src_strerror(*self as i32))
7171
}.to_str().unwrap()
@@ -169,7 +169,7 @@ mod tests {
169169
assert_eq!(ErrorCode::SincPrepareDataBadLen.description(), "Internal error : Bad length in prepare_data ().");
170170
assert_eq!(ErrorCode::BadInternalState.description(), "Error : Someone is trampling on my internal state.");
171171
assert_eq!(ErrorCode::MaxError.description(), "Placeholder. No error defined for this error number.");
172-
assert_eq!(ErrorCode::Unknown.description(), "Unkown error.");
172+
assert_eq!(ErrorCode::Unknown.description(), "Unknown error.");
173173
}
174174

175175
#[test]

src/samplerate.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ mod tests {
314314
}
315315
// Drain the remaining resample buffer
316316
loop {
317-
let (input_used, output_generated) = converter.process_into_last(&[0.; 0], &mut resampled_buff).unwrap();
317+
let (_, output_generated) = converter.process_into_last(&[0.; 0], &mut resampled_buff).unwrap();
318318
if output_generated == 0 {
319319
break;
320320
}
@@ -341,16 +341,14 @@ mod tests {
341341
}
342342
// Drain the remaining resample buffer
343343
loop {
344-
let (input_used, output_generated) = converter.process_into_last(&[0.; 0], &mut resampled_buff).unwrap();
344+
let (_, output_generated) = converter.process_into_last(&[0.; 0], &mut resampled_buff).unwrap();
345345
if output_generated == 0 {
346346
break;
347347
}
348348
output.extend(&resampled_buff[..output_generated])
349349
}
350350
assert_eq!(output.len(), 44100);
351351

352-
let mut invalid = 0;
353-
354352
// Expect the difference between all input frames and all output frames to be less than
355353
// an epsilon.
356354
let error = input.iter().zip(output).fold(0f32, |max, (input, output)| max.max((input - output).abs()));

0 commit comments

Comments
 (0)