]> git.lizzy.rs Git - rust.git/commitdiff
remove redundant returns (clippy::needless_return)
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 21 Mar 2020 12:37:29 +0000 (13:37 +0100)
committerMatthias Krüger <matthias.krueger@famsik.de>
Sat, 21 Mar 2020 14:55:34 +0000 (15:55 +0100)
src/librustc_span/source_map.rs
src/librustdoc/theme.rs

index 39eb318a785e7c69c514946ae95f6b59dd1192e7..8f806909f004731b527bc3d53a4460ff6e0f8b71 100644 (file)
@@ -370,11 +370,11 @@ pub fn mk_substr_filename(&self, sp: Span) -> String {
     pub fn doctest_offset_line(&self, file: &FileName, orig: usize) -> usize {
         match file {
             FileName::DocTest(_, offset) => {
-                return if *offset >= 0 {
-                    orig + *offset as usize
-                } else {
+                if *offset < 0 {
                     orig - (-(*offset)) as usize
-                };
+                } else {
+                    orig + *offset as usize
+                }
             }
             _ => orig,
         }
index a8a571e7c54910182178f7183868671b0f117645..9dd1d3706ffbd61347d58b304fb598ba916fe003 100644 (file)
@@ -234,9 +234,7 @@ pub fn load_css_paths(v: &[u8]) -> CssPath {
 }
 
 pub fn get_differences(against: &CssPath, other: &CssPath, v: &mut Vec<String>) {
-    if against.name != other.name {
-        return;
-    } else {
+    if against.name == other.name {
         for child in &against.children {
             let mut found = false;
             let mut found_working = false;