mirror of
https://github.com/iluvcapra/bwavfile.git
synced 2025-12-31 08:50:44 +00:00
clippy: Avoid () as return type
This commit is contained in:
@@ -320,7 +320,7 @@ impl WaveFmt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Write frames into a byte vector
|
/// 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);
|
let mut write_cursor = Cursor::new(into_bytes);
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
@@ -338,11 +338,10 @@ impl WaveFmt {
|
|||||||
b, self.channel_count, self.block_alignment)
|
b, self.channel_count, self.block_alignment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Read bytes into frames
|
/// 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);
|
let mut rdr = Cursor::new(from_bytes);
|
||||||
for frame in into_frames {
|
for frame in into_frames {
|
||||||
*frame = match (self.valid_bits_per_sample(), self.bits_per_sample) {
|
*frame = match (self.valid_bits_per_sample(), self.bits_per_sample) {
|
||||||
|
|||||||
@@ -33,13 +33,12 @@ where
|
|||||||
AudioFrameWriter { inner }
|
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!(
|
assert!(
|
||||||
from_frames.len() % self.inner.inner.format.channel_count as usize == 0,
|
from_frames.len() % self.inner.inner.format.channel_count as usize == 0,
|
||||||
"frames buffer does not contain a number of samples % channel_count == 0"
|
"frames buffer does not contain a number of samples % channel_count == 0"
|
||||||
);
|
);
|
||||||
self.inner.inner.format.pack_frames(from_frames, to_buffer);
|
self.inner.inner.format.pack_frames(from_frames, to_buffer);
|
||||||
()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Write interleaved samples in `buffer`
|
/// Write interleaved samples in `buffer`
|
||||||
|
|||||||
Reference in New Issue
Block a user