1
Fork 0

remove redundant returns (clippy::needless_return)

This commit is contained in:
Matthias Krüger 2020-03-21 13:37:29 +01:00
parent 1dcbdbdf4f
commit 5566a1cee4
2 changed files with 5 additions and 7 deletions

View file

@ -370,11 +370,11 @@ impl SourceMap {
pub fn doctest_offset_line(&self, file: &FileName, orig: usize) -> usize { pub fn doctest_offset_line(&self, file: &FileName, orig: usize) -> usize {
match file { match file {
FileName::DocTest(_, offset) => { FileName::DocTest(_, offset) => {
return if *offset >= 0 { if *offset < 0 {
orig + *offset as usize
} else {
orig - (-(*offset)) as usize orig - (-(*offset)) as usize
}; } else {
orig + *offset as usize
}
} }
_ => orig, _ => orig,
} }

View 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>) { pub fn get_differences(against: &CssPath, other: &CssPath, v: &mut Vec<String>) {
if against.name != other.name { if against.name == other.name {
return;
} else {
for child in &against.children { for child in &against.children {
let mut found = false; let mut found = false;
let mut found_working = false; let mut found_working = false;