remove macro_use (#9884)

This commit is contained in:
Ryan Dahl 2021-03-26 12:34:25 -04:00 committed by GitHub
parent 6c6f3e87c1
commit f46e39c5c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 101 additions and 107 deletions

View File

@ -1,6 +1,8 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use deno_core::ModuleSpecifier;
use log::debug;
use log::error;
use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq)]

View File

@ -4,7 +4,6 @@
#![allow(dead_code)]
use regex::Regex;
use std::env;
use std::fmt;
use std::io::Write;
use termcolor::Color::{Ansi256, Black, Blue, Cyan, Green, Red, White, Yellow};
@ -13,14 +12,14 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
#[cfg(windows)]
use termcolor::{BufferWriter, ColorChoice};
lazy_static! {
lazy_static::lazy_static! {
// STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
// Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
static ref STRIP_ANSI_RE: Regex = Regex::new(
r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
).unwrap();
static ref NO_COLOR: bool = {
env::var_os("NO_COLOR").is_some()
std::env::var_os("NO_COLOR").is_some()
};
}

View File

@ -63,7 +63,7 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[
"utimeSync",
];
lazy_static! {
lazy_static::lazy_static! {
static ref MSG_MISSING_PROPERTY_DENO: Regex =
Regex::new(r#"Property '([^']+)' does not exist on type 'typeof Deno'"#)
.unwrap();

View File

@ -10,8 +10,6 @@ use crate::http_util::FetchOnceResult;
use crate::media_type::MediaType;
use crate::text_encoding;
use crate::version::get_user_agent;
use deno_runtime::permissions::Permissions;
use deno_core::error::custom_error;
use deno_core::error::generic_error;
use deno_core::error::uri_error;
@ -20,6 +18,9 @@ use deno_core::futures;
use deno_core::futures::future::FutureExt;
use deno_core::ModuleSpecifier;
use deno_runtime::deno_fetch::reqwest;
use deno_runtime::permissions::Permissions;
use log::debug;
use log::info;
use std::collections::HashMap;
use std::env;
use std::fs;

View File

@ -5,6 +5,7 @@ use deno_core::error::AnyError;
use deno_core::futures::ready;
use deno_core::futures::stream::{Stream, StreamExt};
use deno_core::futures::Future;
use log::info;
use notify::event::Event as NotifyEvent;
use notify::event::EventKind;
use notify::Config;

View File

@ -10,11 +10,27 @@ use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::url::Url;
use deno_runtime::permissions::PermissionsOptions;
use log::debug;
use log::Level;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::str::FromStr;
lazy_static::lazy_static! {
static ref LONG_VERSION: String = format!(
"{} ({}, {})\nv8 {}\ntypescript {}",
crate::version::deno(),
if crate::version::is_canary() {
"canary"
} else {
env!("PROFILE")
},
env!("TARGET"),
deno_core::v8_version(),
crate::version::TYPESCRIPT
);
}
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub enum DenoSubcommand {
Bundle {
@ -259,21 +275,6 @@ To evaluate code in the shell:
deno eval \"console.log(30933 + 404)\"
";
lazy_static! {
static ref LONG_VERSION: String = format!(
"{} ({}, {})\nv8 {}\ntypescript {}",
crate::version::deno(),
if crate::version::is_canary() {
"canary"
} else {
env!("PROFILE")
},
env!("TARGET"),
deno_core::v8_version(),
crate::version::TYPESCRIPT
);
}
/// Main entry point for parsing deno's command line flags.
pub fn flags_from_vec(args: Vec<String>) -> clap::Result<Flags> {
let version = crate::version::deno();

View File

@ -1,9 +1,8 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
/// This module is meant to eventually implement HTTP cache
/// as defined in RFC 7234 (https://tools.ietf.org/html/rfc7234).
/// Currently it's a very simplified version to fulfill Deno needs
/// at hand.
//! This module is meant to eventually implement HTTP cache
//! as defined in RFC 7234 (https://tools.ietf.org/html/rfc7234).
//! Currently it's a very simplified version to fulfill Deno needs
//! at hand.
use crate::fs_util;
use crate::http_util::HeadersMap;
use deno_core::error::generic_error;
@ -12,6 +11,7 @@ use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::serde_json;
use deno_core::url::Url;
use log::error;
use std::fs;
use std::fs::File;
use std::io;

View File

@ -15,6 +15,7 @@ use deno_runtime::deno_fetch::reqwest::header::USER_AGENT;
use deno_runtime::deno_fetch::reqwest::redirect::Policy;
use deno_runtime::deno_fetch::reqwest::Client;
use deno_runtime::deno_fetch::reqwest::StatusCode;
use log::debug;
use std::collections::HashMap;
/// Create new instance of async reqwest::Client. This client supports

View File

@ -6,6 +6,8 @@ use deno_core::serde_json::Map;
use deno_core::serde_json::Value;
use deno_core::url::Url;
use indexmap::IndexMap;
use log::debug;
use log::info;
use std::cmp::Ordering;
use std::collections::HashSet;
use std::error::Error;

View File

@ -2,6 +2,7 @@
use deno_core::serde_json;
use deno_core::serde_json::json;
use log::debug;
use std::collections::BTreeMap;
use std::io::Result;
use std::path::PathBuf;

View File

@ -28,7 +28,7 @@ use std::collections::HashMap;
use std::fmt;
use std::rc::Rc;
lazy_static! {
lazy_static::lazy_static! {
/// Diagnostic error codes which actually are the same, and so when grouping
/// fixes we treat them the same.
static ref FIX_ALL_ERROR_CODES: HashMap<&'static str, &'static str> =

View File

@ -15,6 +15,7 @@ use deno_core::error::AnyError;
use deno_core::serde_json;
use deno_core::serde_json::json;
use deno_core::ModuleSpecifier;
use log::error;
use lspower::lsp;
use lspower::Client;
use std::collections::HashMap;

View File

@ -10,6 +10,9 @@ use deno_core::serde_json::json;
use deno_core::serde_json::Value;
use deno_core::ModuleSpecifier;
use dprint_plugin_typescript as dprint;
use log::error;
use log::info;
use log::warn;
use lspower::jsonrpc::Error as LspError;
use lspower::jsonrpc::Result as LspResult;
use lspower::lsp::request::*;
@ -55,7 +58,7 @@ use super::tsc::Assets;
use super::tsc::TsServer;
use super::urls;
lazy_static! {
lazy_static::lazy_static! {
static ref ABSTRACT_MODIFIER: Regex = Regex::new(r"\babstract\b").unwrap();
static ref EXPORT_MODIFIER: Regex = Regex::new(r"\bexport\b").unwrap();
}

View File

@ -31,6 +31,7 @@ use deno_core::JsRuntime;
use deno_core::ModuleSpecifier;
use deno_core::OpFn;
use deno_core::RuntimeOptions;
use log::warn;
use lspower::lsp;
use regex::Captures;
use regex::Regex;

View File

@ -2,11 +2,6 @@
#![deny(warnings)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
mod ast;
mod auth_tokens;
mod checksum;
@ -70,6 +65,8 @@ use deno_runtime::web_worker::WebWorker;
use deno_runtime::web_worker::WebWorkerOptions;
use deno_runtime::worker::MainWorker;
use deno_runtime::worker::WorkerOptions;
use log::debug;
use log::info;
use log::Level;
use log::LevelFilter;
use std::env;

View File

@ -2,9 +2,6 @@
#![deny(warnings)]
#[macro_use]
extern crate lazy_static;
mod colors;
mod standalone;
mod tokio_util;

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::ast;
use crate::ast::parse;
use crate::ast::transpile_module;
@ -23,11 +22,10 @@ use crate::tsc;
use crate::tsc_config::IgnoredCompilerOptions;
use crate::tsc_config::TsConfig;
use crate::version;
use deno_core::error::AnyError;
use deno_core::error::anyhow;
use deno_core::error::custom_error;
use deno_core::error::get_custom_error_class;
use deno_core::error::AnyError;
use deno_core::error::Context;
use deno_core::futures::stream::FuturesUnordered;
use deno_core::futures::stream::StreamExt;
@ -41,6 +39,7 @@ use deno_core::serde_json::Value;
use deno_core::ModuleResolutionError;
use deno_core::ModuleSource;
use deno_core::ModuleSpecifier;
use log::debug;
use regex::Regex;
use std::collections::HashMap;
use std::collections::HashSet;
@ -53,7 +52,7 @@ use std::sync::Arc;
use std::sync::Mutex;
use std::time::Instant;
lazy_static! {
lazy_static::lazy_static! {
/// Matched the `@deno-types` pragma.
static ref DENO_TYPES_RE: Regex =
Regex::new(r#"(?i)^\s*@deno-types\s*=\s*(?:["']([^"']+)["']|(\S+))"#)
@ -846,7 +845,7 @@ impl Graph {
// moved it out of here, we wouldn't know until after the check has already
// happened, which isn't informative to the users.
for specifier in &self.roots {
info!("{} {}", colors::green("Check"), specifier);
log::info!("{} {}", colors::green("Check"), specifier);
}
let root_names = self.get_root_names(!config.get_check_js())?;

View File

@ -25,6 +25,8 @@ use deno_core::resolve_url;
use deno_core::url::Url;
use deno_core::ModuleSource;
use deno_core::ModuleSpecifier;
use log::debug;
use log::warn;
use std::collections::HashMap;
use std::env;
use std::fs::read;

View File

@ -17,6 +17,7 @@ use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::serde_json;
use deno_core::ModuleSpecifier;
use log::debug;
use std::collections::HashMap;
use std::env;
use std::fmt;

View File

@ -16,6 +16,8 @@ use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::futures;
use deno_core::futures::FutureExt;
use log::debug;
use log::info;
use std::fs;
use std::io::stdin;
use std::io::stdout;

View File

@ -1,23 +1,24 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::flags::Flags;
use crate::fs_util::canonicalize_path;
use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::url::Url;
use log::Level;
use regex::{Regex, RegexBuilder};
use regex::Regex;
use regex::RegexBuilder;
use std::env;
use std::fs;
use std::fs::File;
use std::io;
use std::io::Write;
#[cfg(not(windows))]
use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use std::path::PathBuf;
lazy_static! {
#[cfg(not(windows))]
use std::os::unix::fs::PermissionsExt;
lazy_static::lazy_static! {
static ref EXEC_NAME_RE: Regex = RegexBuilder::new(
r"^[a-z][\w-]*$"
).case_insensitive(true).build().unwrap();
@ -337,7 +338,7 @@ mod tests {
use std::sync::Mutex;
use tempfile::TempDir;
lazy_static! {
lazy_static::lazy_static! {
pub static ref ENV_LOCK: Mutex<()> = Mutex::new(());
}

View File

@ -19,6 +19,8 @@ use deno_lint::linter::Linter;
use deno_lint::linter::LinterBuilder;
use deno_lint::rules;
use deno_lint::rules::LintRule;
use log::debug;
use log::info;
use serde::Serialize;
use std::fs;
use std::io::{stdin, Read};

View File

@ -12,7 +12,7 @@ use std::path::PathBuf;
use std::process::Command;
use tempfile::TempDir;
lazy_static! {
lazy_static::lazy_static! {
static ref ARCHIVE_NAME: String = format!("deno-{}.zip", env!("TARGET"));
}

View File

@ -55,7 +55,7 @@ macro_rules! inc {
};
}
lazy_static! {
lazy_static::lazy_static! {
/// Contains static assets that are not preloaded in the compiler snapshot.
pub(crate) static ref STATIC_ASSETS: HashMap<&'static str, &'static str> = (&[
("lib.dom.asynciterable.d.ts", inc!("lib.dom.asynciterable.d.ts")),

View File

@ -9,6 +9,8 @@ use crate::OpTable;
use crate::ZeroCopyBuf;
use futures::future::FutureExt;
use rusty_v8 as v8;
use serde::Serialize;
use serde_v8::to_v8;
use std::cell::Cell;
use std::convert::TryFrom;
use std::convert::TryInto;
@ -17,10 +19,7 @@ use std::option::Option;
use url::Url;
use v8::MapFnTo;
use serde::Serialize;
use serde_v8::to_v8;
lazy_static! {
lazy_static::lazy_static! {
pub static ref EXTERNAL_REFERENCES: v8::ExternalReferences =
v8::ExternalReferences::new(&[
v8::ExternalReference {

View File

@ -1,8 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
#[macro_use]
extern crate log;
use deno_core::error::bad_resource_id;
use deno_core::error::AnyError;
use deno_core::AsyncRefCell;
@ -128,7 +124,7 @@ fn op_listen(
_rid: ResourceId,
_bufs: &mut [ZeroCopyBuf],
) -> Result<u32, AnyError> {
debug!("listen");
log::debug!("listen");
let addr = "127.0.0.1:4544".parse::<SocketAddr>().unwrap();
let std_listener = std::net::TcpListener::bind(&addr)?;
std_listener.set_nonblocking(true)?;
@ -142,7 +138,7 @@ fn op_close(
rid: ResourceId,
_bufs: &mut [ZeroCopyBuf],
) -> Result<u32, AnyError> {
debug!("close rid={}", rid);
log::debug!("close rid={}", rid);
state
.resource_table
.close(rid)
@ -155,7 +151,7 @@ async fn op_accept(
rid: ResourceId,
_bufs: BufVec,
) -> Result<u32, AnyError> {
debug!("accept rid={}", rid);
log::debug!("accept rid={}", rid);
let listener = state
.borrow()
@ -173,7 +169,7 @@ async fn op_read(
mut bufs: BufVec,
) -> Result<u32, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
debug!("read rid={}", rid);
log::debug!("read rid={}", rid);
let stream = state
.borrow()
@ -190,7 +186,7 @@ async fn op_write(
bufs: BufVec,
) -> Result<u32, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
debug!("write rid={}", rid);
log::debug!("write rid={}", rid);
let stream = state
.borrow()

View File

@ -1,8 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
#[macro_use]
extern crate log;
use deno_core::error::bad_resource_id;
use deno_core::error::AnyError;
use deno_core::AsyncRefCell;
@ -135,7 +131,7 @@ fn op_listen(
_args: (),
_bufs: &mut [ZeroCopyBuf],
) -> Result<ResourceId, AnyError> {
debug!("listen");
log::debug!("listen");
let addr = "127.0.0.1:4544".parse::<SocketAddr>().unwrap();
let std_listener = std::net::TcpListener::bind(&addr)?;
std_listener.set_nonblocking(true)?;
@ -149,7 +145,7 @@ fn op_close(
args: ResourceId,
_buf: &mut [ZeroCopyBuf],
) -> Result<(), AnyError> {
debug!("close rid={}", args.rid);
log::debug!("close rid={}", args.rid);
state
.resource_table
.close(args.rid)
@ -162,7 +158,7 @@ async fn op_accept(
args: ResourceId,
_bufs: BufVec,
) -> Result<ResourceId, AnyError> {
debug!("accept rid={}", args.rid);
log::debug!("accept rid={}", args.rid);
let listener = state
.borrow()
@ -180,7 +176,7 @@ async fn op_read(
mut bufs: BufVec,
) -> Result<Value, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
debug!("read rid={}", args.rid);
log::debug!("read rid={}", args.rid);
let stream = state
.borrow()
@ -197,7 +193,7 @@ async fn op_write(
bufs: BufVec,
) -> Result<Value, AnyError> {
assert_eq!(bufs.len(), 1, "Invalid number of arguments");
debug!("write rid={}", args.rid);
log::debug!("write rid={}", args.rid);
let stream = state
.borrow()

View File

@ -3,6 +3,7 @@
// https://github.com/gotham-rs/gotham/blob/bcbbf8923789e341b7a0e62c59909428ca4e22e2/gotham/src/state/mod.rs
// Copyright 2017 Gotham Project Developers. MIT license.
use log::trace;
use std::any::Any;
use std::any::TypeId;
use std::collections::HashMap;

View File

@ -1,10 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
mod async_cancel;
mod async_cell;
mod bindings;

View File

@ -21,7 +21,7 @@ use std::sync::atomic::Ordering;
use std::task::Context;
use std::task::Poll;
lazy_static! {
lazy_static::lazy_static! {
pub static ref NEXT_LOAD_ID: AtomicI32 = AtomicI32::new(0);
}

View File

@ -31,6 +31,7 @@ use futures::stream::StreamExt;
use futures::stream::StreamFuture;
use futures::task::AtomicWaker;
use futures::Future;
use log::debug;
use std::any::Any;
use std::cell::RefCell;
use std::collections::HashMap;

View File

@ -18,6 +18,7 @@ SharedQueue Binary Layout
use crate::bindings;
use crate::ops::OpId;
use log::debug;
use rusty_v8 as v8;
use std::convert::TryInto;

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use regex::Regex;
use std::env;
use std::fmt;
@ -10,15 +9,13 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
#[cfg(windows)]
use termcolor::{BufferWriter, ColorChoice};
lazy_static! {
// STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
// Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
static ref STRIP_ANSI_RE: Regex = Regex::new(
r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
).unwrap();
static ref NO_COLOR: bool = {
env::var_os("NO_COLOR").is_some()
};
lazy_static::lazy_static! {
// STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate.
// Copyright 2017 Armin Ronacher <armin.ronacher@active-4.com>. MIT License.
static ref STRIP_ANSI_RE: Regex = Regex::new(
r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"
).unwrap();
static ref NO_COLOR: bool = env::var_os("NO_COLOR").is_some();
}
/// Helper function to strip ansi codes.

View File

@ -1,6 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use deno_core::Snapshot;
use log::debug;
pub static CLI_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.bin"));

View File

@ -2,11 +2,6 @@
#![deny(warnings)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
pub use deno_console;
pub use deno_crypto;
pub use deno_fetch;

View File

@ -17,6 +17,7 @@ use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
use deno_crypto::rand::thread_rng;
use deno_crypto::rand::Rng;
use log::debug;
use serde::Deserialize;
use std::cell::RefCell;
use std::convert::From;

View File

@ -42,7 +42,7 @@ use tokio::net::unix;
#[cfg(windows)]
use std::os::windows::io::FromRawHandle;
lazy_static! {
lazy_static::lazy_static! {
/// Due to portability issues on Windows handle to stdout is created from raw
/// file descriptor. The caveat of that approach is fact that when this
/// handle is dropped underlying file descriptor is closed - that is highly

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::ops::io::TcpStreamResource;
use crate::permissions::Permissions;
use crate::resolve_addr::resolve_addr;
@ -21,6 +20,7 @@ use deno_core::RcRef;
use deno_core::Resource;
use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
use log::debug;
use serde::Deserialize;
use serde::Serialize;
use std::borrow::Cow;

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::metrics::metrics_op;
use crate::permissions::Permissions;
use deno_core::error::AnyError;
@ -16,6 +15,7 @@ use deno_core::OpState;
use deno_core::Resource;
use deno_core::ZeroCopyBuf;
use dlopen::symbor::Library;
use log::debug;
use serde::Deserialize;
use std::borrow::Cow;
use std::cell::RefCell;

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::permissions::resolve_read_allowlist;
use crate::permissions::resolve_write_allowlist;
use crate::permissions::NetDescriptor;
@ -28,6 +27,7 @@ use deno_core::BufVec;
use deno_core::ModuleSpecifier;
use deno_core::OpState;
use deno_core::ZeroCopyBuf;
use log::debug;
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::colors;
use crate::fs_util::resolve_from_cwd;
use deno_core::error::custom_error;
@ -9,6 +8,7 @@ use deno_core::serde::Deserialize;
use deno_core::serde::Serialize;
use deno_core::url;
use deno_core::ModuleSpecifier;
use log::debug;
use std::collections::HashSet;
use std::fmt;
use std::hash::Hash;
@ -717,7 +717,7 @@ fn permission_prompt(_message: &str) -> bool {
}
#[cfg(test)]
lazy_static! {
lazy_static::lazy_static! {
/// Lock this when you use `set_prompt_result` in a test case.
static ref PERMISSION_PROMPT_GUARD: Mutex<()> = Mutex::new(());
}

View File

@ -1,5 +1,4 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::colors;
use crate::inspector::DenoInspector;
use crate::inspector::InspectorServer;
@ -24,6 +23,7 @@ use deno_core::JsRuntime;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
use log::debug;
use std::env;
use std::rc::Rc;
use std::sync::atomic::AtomicBool;

View File

@ -21,6 +21,7 @@ use deno_core::ModuleId;
use deno_core::ModuleLoader;
use deno_core::ModuleSpecifier;
use deno_core::RuntimeOptions;
use log::debug;
use std::env;
use std::rc::Rc;
use std::sync::Arc;

View File

@ -1,10 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// Usage: provide a port as argument to run hyper_hello benchmark server
// otherwise this starts multiple servers on many ports for test endpoints.
#[macro_use]
extern crate lazy_static;
use futures::FutureExt;
use futures::Stream;
use futures::StreamExt;
@ -16,9 +12,8 @@ use hyper::Body;
use hyper::Request;
use hyper::Response;
use hyper::StatusCode;
use lazy_static::lazy_static;
use os_pipe::pipe;
#[cfg(unix)]
pub use pty;
use regex::Regex;
use serde::Serialize;
use std::collections::HashMap;
@ -48,6 +43,9 @@ use tokio_rustls::rustls;
use tokio_rustls::TlsAcceptor;
use tokio_tungstenite::accept_async;
#[cfg(unix)]
pub use pty;
const PORT: u16 = 4545;
const TEST_AUTH_TOKEN: &str = "abcdef123456789";
const REDIRECT_PORT: u16 = 4546;