Cleanup return statements.

This commit is contained in:
Corey Farwell 2016-10-01 16:47:43 -04:00
parent 6d0894940f
commit a400cccd54
7 changed files with 16 additions and 17 deletions

View File

@ -577,7 +577,7 @@ fn filter_non_trait_generics(trait_did: DefId, mut g: clean::Generics)
_ => true,
}
});
return g;
g
}
/// Supertrait bounds for a trait are also listed in the generics coming from

View File

@ -764,7 +764,7 @@ impl Lifetime {
pub fn get_ref<'a>(&'a self) -> &'a str {
let Lifetime(ref s) = *self;
let s: &'a str = s;
return s;
s
}
pub fn statik() -> Lifetime {
@ -1129,7 +1129,7 @@ pub struct FnDecl {
impl FnDecl {
pub fn has_self(&self) -> bool {
return self.inputs.values.len() > 0 && self.inputs.values[0].name == "self";
self.inputs.values.len() > 0 && self.inputs.values[0].name == "self"
}
pub fn self_type(&self) -> Option<SelfTy> {

View File

@ -141,7 +141,7 @@ pub fn ty_params(mut params: Vec<clean::TyParam>) -> Vec<clean::TyParam> {
for param in &mut params {
param.bounds = ty_bounds(mem::replace(&mut param.bounds, Vec::new()));
}
return params;
params
}
fn ty_bounds(bounds: Vec<clean::TyParamBound>) -> Vec<clean::TyParamBound> {

View File

@ -722,7 +722,7 @@ fn collect(path: &Path, krate: &str,
ret.push(line.to_string());
}
}
return Ok(ret);
Ok(ret)
}
// Update the search index
@ -1208,7 +1208,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
self.seen_mod = orig_seen_mod;
self.stripped_mod = orig_stripped_mod;
self.parent_is_trait_impl = orig_parent_is_trait_impl;
return ret;
ret
}
}
@ -1249,7 +1249,7 @@ fn recurse<T, F>(&mut self, s: String, f: F) -> T where
self.dst = prev;
self.current.pop().unwrap();
return ret;
ret
}
/// Main method for rendering a crate.
@ -1450,7 +1450,7 @@ fn build_sidebar_items(&self, m: &clean::Module) -> BTreeMap<String, Vec<NameDoc
for (_, items) in &mut map {
items.sort();
}
return map;
map
}
}
@ -1647,7 +1647,7 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
let mut s = cx.current.join("::");
s.push_str("::");
s.push_str(item.name.as_ref().unwrap());
return s
s
}
fn shorter<'a>(s: Option<&'a str>) -> String {

View File

@ -288,15 +288,14 @@ pub fn main_args(args: &[String]) -> isize {
passes.into_iter().collect(),
css_file_extension,
renderinfo)
.expect("failed to generate documentation")
.expect("failed to generate documentation");
0
}
Some(s) => {
println!("unknown output format: {}", s);
return 1;
1
}
}
return 0;
}
/// Looks inside the command line arguments to extract the relevant input format

View File

@ -169,7 +169,7 @@ fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions {
}
}
return opts;
opts
}
fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
@ -363,7 +363,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, dont_insert_main: bool,
info!("final test program: {}", prog);
return prog
prog
}
fn partition_source(s: &str) -> (String, String) {
@ -387,7 +387,7 @@ fn partition_source(s: &str) -> (String, String) {
}
}
return (before, after);
(before, after)
}
pub struct Collector {

View File

@ -328,7 +328,7 @@ fn inherits_doc_hidden(cx: &core::DocContext, mut node: ast::NodeId) -> bool {
_ => false,
};
self.view_item_stack.remove(&def_node_id);
return ret;
ret
}
pub fn visit_item(&mut self, item: &hir::Item,