Skip to content

Commit

Permalink
codegen_llvm_back: remove explicit returns
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Nov 10, 2018
1 parent c4c39e9 commit 4286c3c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/librustc_codegen_llvm/back/archive.rs
Expand Up @@ -85,14 +85,14 @@ impl<'a> ArchiveBuilder<'a> {
}

let archive = self.src_archive.as_ref().unwrap().as_ref().unwrap();
let ret = archive.iter()
.filter_map(|child| child.ok())
.filter(is_relevant_child)
.filter_map(|child| child.name())
.filter(|name| !self.removals.iter().any(|x| x == name))
.map(|name| name.to_string())
.collect();
return ret;

archive.iter()
.filter_map(|child| child.ok())
.filter(is_relevant_child)
.filter_map(|child| child.name())
.filter(|name| !self.removals.iter().any(|x| x == name))
.map(|name| name.to_owned())
.collect()
}

fn src_archive(&mut self) -> Option<&ArchiveRO> {
Expand Down Expand Up @@ -293,7 +293,7 @@ impl<'a> ArchiveBuilder<'a> {
for member in members {
llvm::LLVMRustArchiveMemberFree(member);
}
return ret
ret
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_codegen_llvm/back/link.rs
Expand Up @@ -340,7 +340,8 @@ fn archive_search_paths(sess: &Session) -> Vec<PathBuf> {
sess.target_filesearch(PathKind::Native).for_each_lib_search_path(|path, _| {
search.push(path.to_path_buf());
});
return search;

search
}

fn archive_config<'a>(sess: &'a Session,
Expand Down
6 changes: 4 additions & 2 deletions src/librustc_codegen_llvm/back/rpath.rs
Expand Up @@ -59,7 +59,8 @@ fn rpaths_to_flags(rpaths: &[String]) -> Vec<String> {
ret.push(format!("-Wl,-rpath,{}", &(*rpath)));
}
}
return ret;

ret
}

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

// Remove duplicates
let rpaths = minimize_rpaths(&rpaths);
return rpaths;

rpaths
}

fn get_rpaths_relative_to_output(config: &mut RPathConfig,
Expand Down

0 comments on commit 4286c3c

Please sign in to comment.