Remove unsafe code to create empty AudioNodeOptions

This commit is contained in:
Fernando Jiménez Moreno 2018-07-09 16:12:58 +02:00
parent b87fc17b4b
commit 911b8ebd79
4 changed files with 11 additions and 27 deletions

View file

@ -38,13 +38,12 @@ pub struct OscillatorNode {
impl OscillatorNode {
#[allow(unrooted_must_root)]
#[allow(unsafe_code)]
pub fn new_inherited(
window: &Window,
context: &BaseAudioContext,
oscillator_options: &OscillatorOptions,
) -> OscillatorNode {
let mut node_options = unsafe { AudioNodeOptions::empty(window.get_cx()) };
let mut node_options = AudioNodeOptions::empty();
node_options.channelCount = Some(2);
node_options.channelCountMode = Some(ChannelCountMode::Max);
node_options.channelInterpretation = Some(ChannelInterpretation::Speakers);