diff options
author | Andy Hayden <andyhayden1@gmail.com> | 2019-10-03 06:16:06 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-10-03 09:16:06 -0400 |
commit | f7bbd71e219e61dd13bf4533d249150d39f4338e (patch) | |
tree | f7536dbc71f9ce7532177aea0adcb2fa65ba6d79 /cli/source_maps.rs | |
parent | e6e79771998f2488fe9559f1f92344501a10f8f6 (diff) |
Update rust to 1.38.0 (#3030)
Diffstat (limited to 'cli/source_maps.rs')
-rw-r--r-- | cli/source_maps.rs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/cli/source_maps.rs b/cli/source_maps.rs index b2943cddb..ec96ccf5b 100644 --- a/cli/source_maps.rs +++ b/cli/source_maps.rs @@ -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() - { - 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 { |