File tree Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Expand file tree Collapse file tree 6 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ impl AudioBuffer {
124
124
125
125
/// Number of samples per channel in this `AudioBuffer`
126
126
pub fn length ( & self ) -> usize {
127
- self . channels . get ( 0 ) . map ( ChannelData :: len) . unwrap_or ( 0 )
127
+ self . channels . first ( ) . map ( ChannelData :: len) . unwrap_or ( 0 )
128
128
}
129
129
130
130
/// Sample rate of this `AudioBuffer` in Hertz
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ impl AudioContext {
265
265
let mut pending_msgs: Vec < _ > = self . render_thread_init . ctrl_msg_recv . try_iter ( ) . collect ( ) ;
266
266
267
267
// Acquire the active audio graph from the current render thread, shutting it down
268
- let graph = if matches ! ( pending_msgs. get ( 0 ) , Some ( ControlMessage :: Startup { .. } ) ) {
268
+ let graph = if matches ! ( pending_msgs. first ( ) , Some ( ControlMessage :: Startup { .. } ) ) {
269
269
// Handle the edge case where the previous backend was suspended for its entire lifetime.
270
270
// In this case, the `Startup` control message was never processed.
271
271
let msg = pending_msgs. remove ( 0 ) ;
Original file line number Diff line number Diff line change @@ -226,15 +226,15 @@ impl AudioParamEventTimeline {
226
226
}
227
227
228
228
fn unsorted_peek ( & self ) -> Option < & AudioParamEvent > {
229
- self . inner . get ( 0 )
229
+ self . inner . first ( )
230
230
}
231
231
232
232
// panic if dirty, we are doing something wrong here
233
233
fn peek ( & self ) -> Option < & AudioParamEvent > {
234
234
if self . dirty {
235
235
panic ! ( "`AudioParamEventTimeline`: Invalid `.peek()` call, the queue is dirty" ) ;
236
236
}
237
- self . inner . get ( 0 )
237
+ self . inner . first ( )
238
238
}
239
239
240
240
fn next ( & self ) -> Option < & AudioParamEvent > {
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ impl Node {
103
103
104
104
/// Get the current buffer for AudioParam values
105
105
pub fn get_buffer ( & self ) -> & AudioRenderQuantum {
106
- self . outputs . get ( 0 ) . unwrap ( )
106
+ self . outputs . first ( ) . unwrap ( )
107
107
}
108
108
}
109
109
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ impl RenderThread {
204
204
205
205
for quantum in 0 ..num_frames {
206
206
// Suspend at given times and run callbacks
207
- if suspend_callbacks. get ( 0 ) . map ( |& ( q, _) | q) == Some ( quantum) {
207
+ if suspend_callbacks. first ( ) . map ( |& ( q, _) | q) == Some ( quantum) {
208
208
let callback = suspend_callbacks. remove ( 0 ) . 1 ;
209
209
( callback) ( context) ;
210
210
@@ -243,7 +243,7 @@ impl RenderThread {
243
243
244
244
for quantum in 0 ..num_frames {
245
245
// Suspend at given times and run callbacks
246
- if suspend_callbacks. get ( 0 ) . map ( |& ( q, _) | q) == Some ( quantum) {
246
+ if suspend_callbacks. first ( ) . map ( |& ( q, _) | q) == Some ( quantum) {
247
247
let sender = suspend_callbacks. remove ( 0 ) . 1 ;
248
248
sender. send ( ( ) ) . unwrap ( ) ;
249
249
resume_receiver. next ( ) . await ;
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ impl AudioProcessor for AudioWorkletRenderer {
324
324
// Create an iterator for the output channel counts without allocating, handling also the
325
325
// case where self.output_channel_count is empty.
326
326
let single_case = [ inputs
327
- . get ( 0 )
327
+ . first ( )
328
328
. map ( |i| i. number_of_channels ( ) )
329
329
. unwrap_or_default ( ) ] ;
330
330
let output_channel_count = if self . output_channel_count . is_empty ( ) {
You can’t perform that action at this time.
0 commit comments