1
0
Fork 0

Derive a Default instance for the Buffer

To make Clippy happy.
This commit is contained in:
Robbert van der Helm 2022-02-02 20:37:06 +01:00
parent 13369e4085
commit a42649b2de
2 changed files with 2 additions and 8 deletions

View file

@ -18,6 +18,7 @@
/// inputs already copied to the outputs. You can either use the iterator adapters to conveniently
/// and efficiently iterate over the samples, or you can do your own thing using the raw audio
/// buffers.
#[derive(Default)]
pub struct Buffer<'a> {
/// Contains slices for the plugin's outputs. You can't directly create a nested slice form
/// apointer to pointers, so this needs to be preallocated in the setup call and kept around
@ -30,13 +31,6 @@ pub struct Buffer<'a> {
}
impl<'a> Buffer<'a> {
/// Construct a new buffer adapter based on a set of audio buffers.
pub fn new() -> Self {
Self {
output_slices: Vec::new(),
}
}
/// Returns true if this buffer does not contain any samples.
pub fn is_empty(&self) -> bool {
self.output_slices.is_empty() || self.output_slices[0].is_empty()

View file

@ -202,7 +202,7 @@ impl<P: Plugin> WrapperInner<'_, P> {
bypass_state: AtomicBool::new(false),
last_process_status: AtomicCell::new(ProcessStatus::Normal),
current_latency: AtomicU32::new(0),
output_buffer: RwLock::new(Buffer::new()),
output_buffer: RwLock::new(Buffer::default()),
param_hashes: Vec::new(),
param_by_hash: HashMap::new(),