Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rust stable to 1.38.0 #3030

Merged
merged 3 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sudo: false
language: rust
rust:
- 1.37.0
- 1.38.0
git:
depth: 1
env:
Expand Down
4 changes: 2 additions & 2 deletions cli/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
8 changes: 1 addition & 7 deletions cli/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
}
Expand Down
25 changes: 13 additions & 12 deletions cli/source_maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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()
{
getter.get_source_line(
&v8_exception.script_resource_name.clone().unwrap(),
line_number.unwrap() as usize,
)
} else {
v8_exception.source_line.clone()
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(),
ln as usize,
)
}
_ => v8_exception.source_line.clone(),
};

V8Exception {
Expand Down
4 changes: 2 additions & 2 deletions cli/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/module_specifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down