Skip to content

Commit 5566a1c

Browse files
committed
remove redundant returns (clippy::needless_return)
1 parent 1dcbdbd commit 5566a1c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustc_span/source_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,11 @@ impl SourceMap {
370370
pub fn doctest_offset_line(&self, file: &FileName, orig: usize) -> usize {
371371
match file {
372372
FileName::DocTest(_, offset) => {
373-
return if *offset >= 0 {
374-
orig + *offset as usize
375-
} else {
373+
if *offset < 0 {
376374
orig - (-(*offset)) as usize
377-
};
375+
} else {
376+
orig + *offset as usize
377+
}
378378
}
379379
_ => orig,
380380
}

src/librustdoc/theme.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@ pub fn load_css_paths(v: &[u8]) -> CssPath {
234234
}
235235

236236
pub fn get_differences(against: &CssPath, other: &CssPath, v: &mut Vec<String>) {
237-
if against.name != other.name {
238-
return;
239-
} else {
237+
if against.name == other.name {
240238
for child in &against.children {
241239
let mut found = false;
242240
let mut found_working = false;

0 commit comments

Comments
 (0)