1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00

Update rust to 1.38.0 (#3030)

This commit is contained in:
Andy Hayden 2019-10-03 06:16:06 -07:00 committed by Ryan Dahl
parent e6e7977199
commit f7bbd71e21
8 changed files with 23 additions and 28 deletions

View file

@ -13,7 +13,7 @@ environment:
DENO_BUILD_PATH: $(APPVEYOR_BUILD_FOLDER)\target\release
DENO_THIRD_PARTY_PATH: $(APPVEYOR_BUILD_FOLDER)\third_party
RELEASE_ARTIFACT: deno_win_x64.zip
RUST_VERSION: 1.37.0
RUST_VERSION: 1.38.0
RUST_DIR: $(USERPROFILE)\rust-$(RUST_VERSION)
CARGO_HOME: $(RUST_DIR)\cargo
RUSTUP_HOME: $(RUST_DIR)\rustup

View file

@ -28,7 +28,7 @@ jobs:
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: "1.37.0"
rust-version: "1.38.0"
- name: Install python
uses: actions/setup-python@v1

View file

@ -2,7 +2,7 @@
sudo: false
language: rust
rust:
- 1.37.0
- 1.38.0
git:
depth: 1
env:

View file

@ -682,8 +682,8 @@ fn parse_script_args(
let matches =
cli_app.get_matches_from_safe(vec!["deno".to_string(), arg.to_string()]);
if matches.is_ok() {
flags = parse_flags(&matches.unwrap(), Some(flags));
if let Ok(m) = matches {
flags = parse_flags(&m, Some(flags));
} else {
argv.push(arg.to_string());
}

View file

@ -539,13 +539,7 @@ pub fn get_file(rid: ResourceId) -> Result<std::fs::File, ErrBox> {
// Insert the entry back with the same rid.
table.insert(rid, Repr::FsFile(tokio_fs::File::from_std(std_file)));
if maybe_std_file_copy.is_err() {
return Err(ErrBox::from(maybe_std_file_copy.unwrap_err()));
}
let std_file_copy = maybe_std_file_copy.unwrap();
Ok(std_file_copy)
maybe_std_file_copy.map_err(ErrBox::from)
}
_ => Err(bad_resource()),
}

View file

@ -110,8 +110,8 @@ pub fn apply_source_map<G: SourceMapGetter>(
// source file map.
let end_column = match v8_exception.end_column {
Some(ec) => {
if start_column.is_some() {
Some(ec - (v8_exception.start_column.unwrap() - start_column.unwrap()))
if let Some(sc) = start_column {
Some(ec - (v8_exception.start_column.unwrap() - sc))
} else {
None
}
@ -120,16 +120,17 @@ pub fn apply_source_map<G: SourceMapGetter>(
};
// if there is a source line that we might be different in the source file, we
// will go fetch it from the getter
let source_line = if v8_exception.source_line.is_some()
&& script_resource_name.is_some()
&& line_number.is_some()
let source_line = match line_number {
Some(ln)
if v8_exception.source_line.is_some()
&& script_resource_name.is_some() =>
{
getter.get_source_line(
&v8_exception.script_resource_name.clone().unwrap(),
line_number.unwrap() as usize,
ln as usize,
)
} else {
v8_exception.source_line.clone()
}
_ => v8_exception.source_line.clone(),
};
V8Exception {

View file

@ -171,8 +171,8 @@ impl Loader for ThreadSafeState {
if !is_main {
if let Some(import_map) = &self.import_map {
let result = import_map.resolve(specifier, referrer)?;
if result.is_some() {
return Ok(result.unwrap());
if let Some(r) = result {
return Ok(r);
}
}
}

View file

@ -78,7 +78,7 @@ impl ModuleSpecifier {
|| specifier.starts_with("./")
|| specifier.starts_with("../")) =>
{
Err(ImportPrefixMissing(specifier.to_string()))?
return Err(ImportPrefixMissing(specifier.to_string()))
}
// 3. Return the result of applying the URL parser to specifier with base
@ -103,7 +103,7 @@ impl ModuleSpecifier {
// it being relative, always return the original error. We don't want to
// return `ImportPrefixMissing` or `InvalidBaseUrl` if the real
// problem lies somewhere else.
Err(err) => Err(InvalidUrl(err))?,
Err(err) => return Err(InvalidUrl(err)),
};
Ok(ModuleSpecifier(url))