Skip to content

Commit

Permalink
Cleanup return statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Oct 3, 2016
1 parent 6d08949 commit a400ccc
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/inline.rs
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/simplify.rs
Expand Up @@ -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> {
Expand Down
10 changes: 5 additions & 5 deletions src/librustdoc/html/render.rs
Expand Up @@ -722,7 +722,7 @@ fn write_shared(cx: &Context,
ret.push(line.to_string());
}
}
return Ok(ret);
Ok(ret)
}

// Update the search index
Expand Down Expand Up @@ -1208,7 +1208,7 @@ impl DocFolder for Cache {
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
}
}

Expand Down Expand Up @@ -1249,7 +1249,7 @@ impl Context {
self.dst = prev;
self.current.pop().unwrap();

return ret;
ret
}

/// Main method for rendering a crate.
Expand Down Expand Up @@ -1450,7 +1450,7 @@ impl Context {
for (_, items) in &mut map {
items.sort();
}
return map;
map
}
}

Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions src/librustdoc/lib.rs
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/test.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand All @@ -387,7 +387,7 @@ fn partition_source(s: &str) -> (String, String) {
}
}

return (before, after);
(before, after)
}

pub struct Collector {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/visit_ast.rs
Expand Up @@ -328,7 +328,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
_ => false,
};
self.view_item_stack.remove(&def_node_id);
return ret;
ret
}

pub fn visit_item(&mut self, item: &hir::Item,
Expand Down

0 comments on commit a400ccc

Please sign in to comment.