clippy: Avoid () as return type

This commit is contained in:
Ian Hobson
2023-05-12 16:52:06 +02:00
parent cf5ec121da
commit f6f4869b5b
2 changed files with 3 additions and 5 deletions

View File

@@ -320,7 +320,7 @@ impl WaveFmt {
}
/// Write frames into a byte vector
pub fn pack_frames(&self, from_frames: &[i32], into_bytes: &mut [u8]) -> () {
pub fn pack_frames(&self, from_frames: &[i32], into_bytes: &mut [u8]) {
let mut write_cursor = Cursor::new(into_bytes);
assert!(
@@ -338,11 +338,10 @@ impl WaveFmt {
b, self.channel_count, self.block_alignment)
}
}
()
}
/// Read bytes into frames
pub fn unpack_frames(&self, from_bytes: &[u8], into_frames: &mut [i32]) -> () {
pub fn unpack_frames(&self, from_bytes: &[u8], into_frames: &mut [i32]) {
let mut rdr = Cursor::new(from_bytes);
for frame in into_frames {
*frame = match (self.valid_bits_per_sample(), self.bits_per_sample) {

View File

@@ -33,13 +33,12 @@ where
AudioFrameWriter { inner }
}
fn write_integer_frames_to_buffer(&self, from_frames: &[i32], to_buffer: &mut [u8]) -> () {
fn write_integer_frames_to_buffer(&self, from_frames: &[i32], to_buffer: &mut [u8]) {
assert!(
from_frames.len() % self.inner.inner.format.channel_count as usize == 0,
"frames buffer does not contain a number of samples % channel_count == 0"
);
self.inner.inner.format.pack_frames(from_frames, to_buffer);
()
}
/// Write interleaved samples in `buffer`