From 9a783ae4e6789fc90c8a6d62e846c9abd29e7d2f Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 5 Jun 2020 04:23:07 +0200 Subject: [PATCH] ci: upgrade to Rust 1.44.0 (#6113) --- .github/workflows/ci.yml | 2 +- cli/swc_util.rs | 2 +- cli/tests/integration_tests.rs | 2 +- cli/tsc.rs | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d6cab782a..532a7c1e74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - name: Install rust uses: hecrj/setup-rust-action@v1 with: - rust-version: "1.43.0" + rust-version: 1.44.0 - name: Install clippy and rustfmt if: matrix.config.kind == 'lint' diff --git a/cli/swc_util.rs b/cli/swc_util.rs index 0d1d1ba089..0d75877bf3 100644 --- a/cli/swc_util.rs +++ b/cli/swc_util.rs @@ -521,7 +521,7 @@ pub fn analyze_dependencies_and_references( let comments = parser .comments .take_leading_comments(module_span.lo()) - .unwrap_or_else(|| vec![]); + .unwrap_or_else(Vec::new); let mut references = vec![]; for comment in comments { diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index ff94d2f502..54d88b8740 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2787,7 +2787,7 @@ mod util { pub const PERMISSION_DENIED_PATTERN: &str = "PermissionDenied"; lazy_static! { - static ref DENO_DIR: TempDir = { TempDir::new().expect("tempdir fail") }; + static ref DENO_DIR: TempDir = TempDir::new().expect("tempdir fail"); // STRIP_ANSI_RE and strip_ansi_codes are lifted from the "console" crate. // Copyright 2017 Armin Ronacher . MIT License. diff --git a/cli/tsc.rs b/cli/tsc.rs index 2eb8a35a02..1b3208e753 100644 --- a/cli/tsc.rs +++ b/cli/tsc.rs @@ -833,12 +833,12 @@ impl SourceMapGetter for TsCompiler { self .try_resolve_and_get_source_file(script_name) .and_then(|out| { - str::from_utf8(&out.source_code).ok().and_then(|v| { + str::from_utf8(&out.source_code).ok().map(|v| { // Do NOT use .lines(): it skips the terminating empty line. // (due to internally using .split_terminator() instead of .split()) let lines: Vec<&str> = v.split('\n').collect(); assert!(lines.len() > line); - Some(lines[line].to_string()) + lines[line].to_string() }) }) }