Skip to content

Commit 4286c3c

Browse files
committed
codegen_llvm_back: remove explicit returns
1 parent c4c39e9 commit 4286c3c

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

src/librustc_codegen_llvm/back/archive.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ impl<'a> ArchiveBuilder<'a> {
8585
}
8686

8787
let archive = self.src_archive.as_ref().unwrap().as_ref().unwrap();
88-
let ret = archive.iter()
89-
.filter_map(|child| child.ok())
90-
.filter(is_relevant_child)
91-
.filter_map(|child| child.name())
92-
.filter(|name| !self.removals.iter().any(|x| x == name))
93-
.map(|name| name.to_string())
94-
.collect();
95-
return ret;
88+
89+
archive.iter()
90+
.filter_map(|child| child.ok())
91+
.filter(is_relevant_child)
92+
.filter_map(|child| child.name())
93+
.filter(|name| !self.removals.iter().any(|x| x == name))
94+
.map(|name| name.to_owned())
95+
.collect()
9696
}
9797

9898
fn src_archive(&mut self) -> Option<&ArchiveRO> {
@@ -293,7 +293,7 @@ impl<'a> ArchiveBuilder<'a> {
293293
for member in members {
294294
llvm::LLVMRustArchiveMemberFree(member);
295295
}
296-
return ret
296+
ret
297297
}
298298
}
299299
}

src/librustc_codegen_llvm/back/link.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ fn archive_search_paths(sess: &Session) -> Vec<PathBuf> {
340340
sess.target_filesearch(PathKind::Native).for_each_lib_search_path(|path, _| {
341341
search.push(path.to_path_buf());
342342
});
343-
return search;
343+
344+
search
344345
}
345346

346347
fn archive_config<'a>(sess: &'a Session,

src/librustc_codegen_llvm/back/rpath.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ fn rpaths_to_flags(rpaths: &[String]) -> Vec<String> {
5959
ret.push(format!("-Wl,-rpath,{}", &(*rpath)));
6060
}
6161
}
62-
return ret;
62+
63+
ret
6364
}
6465

6566
fn get_rpaths(config: &mut RPathConfig, libs: &[PathBuf]) -> Vec<String> {
@@ -92,7 +93,8 @@ fn get_rpaths(config: &mut RPathConfig, libs: &[PathBuf]) -> Vec<String> {
9293

9394
// Remove duplicates
9495
let rpaths = minimize_rpaths(&rpaths);
95-
return rpaths;
96+
97+
rpaths
9698
}
9799

98100
fn get_rpaths_relative_to_output(config: &mut RPathConfig,

0 commit comments

Comments
 (0)