From 7f88b5fff3fe8aed2073d4347d3ab847fc4c528a Mon Sep 17 00:00:00 2001 From: JaePil Jung Date: Fri, 25 Jan 2019 00:54:43 +0900 Subject: [PATCH] Minor code cleanups (#1570) --- .appveyor.yml | 2 +- .travis.yml | 2 +- libdeno/deno.gni | 2 +- src/isolate.rs | 3 ++- tools/lint.py | 3 +-- tools/run_node.py | 7 +++---- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5bf1c9c5cc..3c9b5dd0e4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -# Copyright 2018 the Deno authors. All rights reserved. MIT license. +# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. version: '{build}.{branch}' skip_branch_with_pr: true diff --git a/.travis.yml b/.travis.yml index 18e32a734d..50c0c13176 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# Copyright 2018 the Deno authors. All rights reserved. MIT license. +# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. sudo: false language: c++ git: diff --git a/libdeno/deno.gni b/libdeno/deno.gni index 64869a284c..41627ea13a 100644 --- a/libdeno/deno.gni +++ b/libdeno/deno.gni @@ -1,4 +1,4 @@ -# Copyright 2018 the Deno authors. All rights reserved. MIT license. +# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import("//build/compiled_action.gni") template("run_node") { diff --git a/src/isolate.rs b/src/isolate.rs index 5100ac4907..7d1fdf71d1 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -28,6 +28,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc; use std::sync::Arc; use std::sync::Mutex; +use std::sync::{Once, ONCE_INIT}; use std::time::Duration; use std::time::Instant; use tokio; @@ -156,7 +157,7 @@ pub struct Metrics { pub bytes_received: AtomicUsize, } -static DENO_INIT: std::sync::Once = std::sync::ONCE_INIT; +static DENO_INIT: Once = ONCE_INIT; impl Isolate { pub fn new( diff --git a/tools/lint.py b/tools/lint.py index 94b79739c3..4c38d3c69e 100755 --- a/tools/lint.py +++ b/tools/lint.py @@ -4,11 +4,10 @@ import os import sys -from util import enable_ansi_colors, run, find_exts +from util import enable_ansi_colors, find_exts, root_path, run enable_ansi_colors() -root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) third_party_path = os.path.join(root_path, "third_party") cpplint = os.path.join(third_party_path, "cpplint", "cpplint.py") tslint = os.path.join(third_party_path, "node_modules", "tslint", "bin", diff --git a/tools/run_node.py b/tools/run_node.py index 4023f7586f..f1221bcd4a 100755 --- a/tools/run_node.py +++ b/tools/run_node.py @@ -8,13 +8,12 @@ Before running node, we symlink js/node_modules to out/Debug/node_modules. import subprocess import sys import os -import util +from util import remove_and_symlink, root_path, run -root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) tools_path = os.path.join(root_path, "tools") third_party_path = os.path.join(root_path, "third_party") target_abs = os.path.join(third_party_path, "node_modules") target_rel = os.path.relpath(target_abs) -util.remove_and_symlink(target_rel, "node_modules", True) -util.run(["node"] + sys.argv[1:], quiet=True) +remove_and_symlink(target_rel, "node_modules", True) +run(["node"] + sys.argv[1:], quiet=True)