From 6fa6828e5f0f7abac20ec342ee5ec57654a425d0 Mon Sep 17 00:00:00 2001 From: Gurwinder Singh Date: Sun, 23 Jun 2019 17:19:49 +0530 Subject: Minor tweaks (#2569) 1. Separate Snapshot and Script StartupData functions based on cfg "no-snapshot-init" 2. Replace deprecated Once::ONCE_INIT with Once::new (https://github.com/rust-lang/rust/pull/61757) 3. Elide lifetime 4. Fix typos --- core/isolate.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/isolate.rs b/core/isolate.rs index cdb505342..2e6406e56 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -25,7 +25,7 @@ use libc::c_void; use std::ffi::CStr; use std::ffi::CString; use std::ptr::null; -use std::sync::{Arc, Mutex, Once, ONCE_INIT}; +use std::sync::{Arc, Mutex, Once}; pub type Buf = Box<[u8]>; @@ -55,8 +55,8 @@ struct OwnedScript { pub filename: String, } -impl<'a> From> for OwnedScript { - fn from(s: Script<'a>) -> OwnedScript { +impl From> for OwnedScript { + fn from(s: Script) -> OwnedScript { OwnedScript { source: s.source.to_string(), filename: s.filename.to_string(), @@ -133,10 +133,10 @@ impl Drop for Isolate { } } -static DENO_INIT: Once = ONCE_INIT; +static DENO_INIT: Once = Once::new(); impl Isolate { - /// startup_data defines the snapshot or script used at startup to initalize + /// startup_data defines the snapshot or script used at startup to initialize /// the isolate. pub fn new(startup_data: StartupData, will_snapshot: bool) -> Self { DENO_INIT.call_once(|| { @@ -157,7 +157,7 @@ impl Isolate { let mut startup_script: Option = None; - // Seperate into Option values for each startup type + // Separate into Option values for each startup type match startup_data { StartupData::Script(d) => { startup_script = Some(d.into()); -- cgit v1.2.3