summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/deno_dir.rs2
-rw-r--r--cli/flags.rs6
-rw-r--r--cli/ops.rs2
-rw-r--r--cli/state.rs2
-rw-r--r--cli/tokio_util.rs1
-rw-r--r--cli/worker.rs5
6 files changed, 7 insertions, 11 deletions
diff --git a/cli/deno_dir.rs b/cli/deno_dir.rs
index 69496b701..5dc9afed3 100644
--- a/cli/deno_dir.rs
+++ b/cli/deno_dir.rs
@@ -652,7 +652,7 @@ fn fetch_remote_source_async(
filename: filename.to_string(),
media_type: map_content_type(
&p,
- maybe_content_type.as_ref().map(|s| s.as_str()),
+ maybe_content_type.as_ref().map(String::as_str),
),
source_code: source.as_bytes().to_owned(),
maybe_output_code_filename: None,
diff --git a/cli/flags.rs b/cli/flags.rs
index 3fd3f91fb..3aac1ecc8 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -96,7 +96,7 @@ static ENV_VARIABLES_HELP: &str = "ENVIRONMENT VARIABLES:
NO_COLOR Set to disable color";
fn create_cli_app<'a, 'b>() -> App<'a, 'b> {
- let cli_app = App::new("deno")
+ App::new("deno")
.bin_name("deno")
.global_settings(&[AppSettings::ColorNever])
.settings(&[
@@ -194,9 +194,7 @@ fn create_cli_app<'a, 'b>() -> App<'a, 'b> {
// AppSettings:AllowExternalSubcommand to treat it as an
// entry point script
SubCommand::with_name("<script>").about("Script to run"),
- );
-
- cli_app
+ )
}
#[cfg_attr(feature = "cargo-clippy", allow(stutter))]
diff --git a/cli/ops.rs b/cli/ops.rs
index 5e2a62439..0ce9d97a4 100644
--- a/cli/ops.rs
+++ b/cli/ops.rs
@@ -295,7 +295,7 @@ fn op_start(
let mut builder = FlatBufferBuilder::new();
let state = state;
- let argv = state.argv.iter().map(|s| s.as_str()).collect::<Vec<_>>();
+ let argv = state.argv.iter().map(String::as_str).collect::<Vec<_>>();
let argv_off = builder.create_vector_of_strings(argv.as_slice());
let cwd_path = std::env::current_dir().unwrap();
diff --git a/cli/state.rs b/cli/state.rs
index 24f2f5053..9a74cbfa2 100644
--- a/cli/state.rs
+++ b/cli/state.rs
@@ -90,7 +90,7 @@ impl ThreadSafeState {
argv_rest: Vec<String>,
dispatch_selector: ops::OpSelector,
) -> Self {
- let custom_root = env::var("DENO_DIR").map(|s| s.into()).ok();
+ let custom_root = env::var("DENO_DIR").map(String::into).ok();
let (worker_in_tx, worker_in_rx) = async_mpsc::channel::<Buf>(1);
let (worker_out_tx, worker_out_rx) = async_mpsc::channel::<Buf>(1);
diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs
index bf27c39f0..5b975ff40 100644
--- a/cli/tokio_util.rs
+++ b/cli/tokio_util.rs
@@ -48,7 +48,6 @@ pub fn init<F>(f: F)
where
F: FnOnce(),
{
- use tokio_executor;
let rt = tokio::runtime::Runtime::new().unwrap();
let mut executor = rt.executor();
let mut enter = tokio_executor::enter().expect("Multiple executors at once");
diff --git a/cli/worker.rs b/cli/worker.rs
index c43dbf6ee..5a4299214 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -119,7 +119,7 @@ pub fn resolve_module_spec(
// two-character sequence U+002E FULL STOP, U+002F SOLIDUS (./), or the
// three-character sequence U+002E FULL STOP, U+002E FULL STOP, U+002F
// SOLIDUS (../), return failure.
- if !specifier.starts_with("/")
+ if !specifier.starts_with('/')
&& !specifier.starts_with("./")
&& !specifier.starts_with("../")
{
@@ -158,8 +158,7 @@ impl Loader for Worker {
type Error = DenoError;
fn resolve(specifier: &str, referrer: &str) -> Result<String, Self::Error> {
- resolve_module_spec(specifier, referrer)
- .map_err(|url_err| DenoError::from(url_err))
+ resolve_module_spec(specifier, referrer).map_err(DenoError::from)
}
/// Given an absolute url, load its source code.