Take WorkerGlobalScope's worker_id out of its Option.

Unsurprisingly, every worker has an id, so there is no need to wrap it in an
Option.
This commit is contained in:
Ms2ger 2015-08-03 18:28:48 +02:00
parent 1809748dc1
commit bd04cecceb
4 changed files with 8 additions and 8 deletions

View file

@ -46,7 +46,7 @@ pub enum WorkerGlobalScopeTypeId {
#[dom_struct]
pub struct WorkerGlobalScope {
eventtarget: EventTarget,
worker_id: Option<WorkerId>,
worker_id: WorkerId,
worker_url: Url,
runtime: Rc<Runtime>,
next_worker_id: Cell<WorkerId>,
@ -84,7 +84,7 @@ impl WorkerGlobalScope {
devtools_sender: Option<IpcSender<DevtoolScriptControlMsg>>,
devtools_receiver: Receiver<DevtoolScriptControlMsg>,
constellation_chan: ConstellationChan,
worker_id: Option<WorkerId>)
worker_id: WorkerId)
-> WorkerGlobalScope {
WorkerGlobalScope {
eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)),
@ -144,7 +144,7 @@ impl WorkerGlobalScope {
&self.worker_url
}
pub fn get_worker_id(&self) -> Option<WorkerId> {
pub fn get_worker_id(&self) -> WorkerId {
self.worker_id.clone()
}