diff options
author | chansuke <chansuke@georepublic.de> | 2018-09-18 23:24:15 +0900 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-09-19 17:40:47 -0400 |
commit | c37a345dc9f4dda6ea29c42f96f6c7201c42cbac (patch) | |
tree | 1f05b49bac02318455a59d5b143c186fd872bdb9 /components/script/dom/offlineaudiocontext.rs | |
parent | 2ca7a134736bb4759ff209c1bc0b6dc3cc1984c9 (diff) | |
download | servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.tar.gz servo-c37a345dc9f4dda6ea29c42f96f6c7201c42cbac.zip |
Format script component
Diffstat (limited to 'components/script/dom/offlineaudiocontext.rs')
-rw-r--r-- | components/script/dom/offlineaudiocontext.rs | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/components/script/dom/offlineaudiocontext.rs b/components/script/dom/offlineaudiocontext.rs index 21376c11a4d..899574e35e4 100644 --- a/components/script/dom/offlineaudiocontext.rs +++ b/components/script/dom/offlineaudiocontext.rs @@ -41,17 +41,14 @@ pub struct OfflineAudioContext { impl OfflineAudioContext { #[allow(unrooted_must_root)] - fn new_inherited(channel_count: u32, - length: u32, - sample_rate: f32) -> OfflineAudioContext { + fn new_inherited(channel_count: u32, length: u32, sample_rate: f32) -> OfflineAudioContext { let options = ServoMediaOfflineAudioContextOptions { channels: channel_count as u8, length: length as usize, sample_rate, }; - let context = BaseAudioContext::new_inherited( - BaseAudioContextOptions::OfflineAudioContext(options), - ); + let context = + BaseAudioContext::new_inherited(BaseAudioContextOptions::OfflineAudioContext(options)); OfflineAudioContext { context, channel_count, @@ -62,10 +59,12 @@ impl OfflineAudioContext { } #[allow(unrooted_must_root)] - fn new(window: &Window, - channel_count: u32, - length: u32, - sample_rate: f32) -> DomRoot<OfflineAudioContext> { + fn new( + window: &Window, + channel_count: u32, + length: u32, + sample_rate: f32, + ) -> DomRoot<OfflineAudioContext> { let context = OfflineAudioContext::new_inherited(channel_count, length, sample_rate); reflect_dom_object(Box::new(context), window, OfflineAudioContextBinding::Wrap) } @@ -74,7 +73,12 @@ impl OfflineAudioContext { window: &Window, options: &OfflineAudioContextOptions, ) -> Fallible<DomRoot<OfflineAudioContext>> { - Ok(OfflineAudioContext::new(window, options.numberOfChannels, options.length, *options.sampleRate)) + Ok(OfflineAudioContext::new( + window, + options.numberOfChannels, + options.length, + *options.sampleRate, + )) } pub fn Constructor_( @@ -92,7 +96,12 @@ impl OfflineAudioContext { return Err(Error::NotSupported); } - Ok(OfflineAudioContext::new(window, number_of_channels, length, *sample_rate)) + Ok(OfflineAudioContext::new( + window, + number_of_channels, + length, + *sample_rate, + )) } } |