diff options
author | Bert Belder <bertbelder@gmail.com> | 2019-01-15 13:06:25 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-15 07:06:25 -0500 |
commit | d8adeb41de2daab15a0d30eeead9796fa58bfbc3 (patch) | |
tree | 030670147587a2ebc04506a3dcad7bd34bce1016 /src/js_errors.rs | |
parent | 48ca06e420d08d15ac6653ab73c6249eb99428a7 (diff) |
Clippy fixes (also fixes build with nightly) (#1527)
Diffstat (limited to 'src/js_errors.rs')
-rw-r--r-- | src/js_errors.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/js_errors.rs b/src/js_errors.rs index b16a6dc35..ea94f7c0a 100644 --- a/src/js_errors.rs +++ b/src/js_errors.rs @@ -60,7 +60,7 @@ impl ToString for StackFrame { fn to_string(&self) -> String { // Note when we print to string, we change from 0-indexed to 1-indexed. let (line, column) = (self.line + 1, self.column + 1); - if self.function_name.len() > 0 { + if !self.function_name.is_empty() { format!( " at {} ({}:{}:{})", self.function_name, self.script_name, line, column @@ -228,10 +228,10 @@ impl SourceMap { // Ugly. Maybe use serde_derive. match serde_json::from_str::<serde_json::Value>(json_str) { Ok(serde_json::Value::Object(map)) => match map["mappings"].as_str() { - None => return None, + None => None, Some(mappings_str) => { match parse_mappings::<()>(mappings_str.as_bytes()) { - Err(_) => return None, + Err(_) => None, Ok(mappings) => { if !map["sources"].is_array() { return None; @@ -248,12 +248,12 @@ impl SourceMap { } } - return Some(SourceMap { sources, mappings }); + Some(SourceMap { sources, mappings }) } } } }, - _ => return None, + _ => None, } } } |