From c59f90d01f06f995e335c6de76aab0b9ba2c98e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 4 Dec 2021 14:19:06 +0100 Subject: chore: upgrade to Rust 1.57.0 (#12968) --- cli/lsp/mod.rs | 3 +++ cli/tools/installer.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/lsp/mod.rs b/cli/lsp/mod.rs index 27795e698..bbfb757dc 100644 --- a/cli/lsp/mod.rs +++ b/cli/lsp/mod.rs @@ -1,5 +1,8 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +// FIXME(bartlomieju): remove this attribute +#![allow(unused)] + use deno_core::error::AnyError; use lspower::LspService; use lspower::Server; diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index a426fea0f..252939f85 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -137,7 +137,7 @@ pub fn infer_name_from_url(url: &Url) -> Option { stem = parent_name.to_string_lossy().to_string(); } } - let stem = stem.splitn(2, '@').next().unwrap().to_string(); + let stem = stem.split_once('@').map_or(&*stem, |x| x.0).to_string(); Some(stem) } -- cgit v1.2.3