chore: upgrade to Rust 1.57.0 (#12968)

This commit is contained in:
Bartek Iwańczuk 2021-12-04 14:19:06 +01:00 committed by GitHub
parent 72e9720e91
commit c59f90d01f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 29 deletions

View file

@ -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;

View file

@ -137,7 +137,7 @@ pub fn infer_name_from_url(url: &Url) -> Option<String> {
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)
}