Skip to content

Commit 12657fa

Browse files
committed
Delete useless and probably confusing inner scope
1 parent 3209aa5 commit 12657fa

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/node/audio_buffer_source.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,12 @@ impl AudioBufferSourceNode {
246246
///
247247
/// Panics if the source was already started
248248
pub fn start_at_with_offset_and_duration(&self, start: f64, offset: f64, duration: f64) {
249-
{
250-
let source_started = &mut self.inner_state.borrow_mut().source_started;
251-
assert!(
252-
!*source_started,
253-
"InvalidStateError: Cannot call `start` twice"
254-
);
255-
*source_started = true;
256-
// Drop the mutable borrow
257-
}
249+
let source_started = &mut self.inner_state.borrow_mut().source_started;
250+
assert!(
251+
!*source_started,
252+
"InvalidStateError: Cannot call `start` twice"
253+
);
254+
*source_started = true;
258255

259256
let control = ControlMessage::StartWithOffsetAndDuration(start, offset, duration);
260257
self.registration.post_message(control);

0 commit comments

Comments
 (0)