diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index d2475d1e4e7..208a5d81092 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -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 diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 141a186d1e0..12093a1bc0f 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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 { diff --git a/src/librustdoc/clean/simplify.rs b/src/librustdoc/clean/simplify.rs index 7ae17743906..15e042f8c08 100644 --- a/src/librustdoc/clean/simplify.rs +++ b/src/librustdoc/clean/simplify.rs @@ -141,7 +141,7 @@ pub fn ty_params(mut params: Vec) -> Vec { for param in &mut params { param.bounds = ty_bounds(mem::replace(&mut param.bounds, Vec::new())); } - return params; + params } fn ty_bounds(bounds: Vec) -> Vec { diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 46461226381..d2d12ef3c32 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -722,7 +722,7 @@ fn write_shared(cx: &Context, ret.push(line.to_string()); } } - return Ok(ret); + Ok(ret) } // Update the search index @@ -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 } } @@ -1249,7 +1249,7 @@ impl Context { self.dst = prev; self.current.pop().unwrap(); - return ret; + ret } /// Main method for rendering a crate. @@ -1450,7 +1450,7 @@ impl Context { 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 { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 1ff84b95da6..006dda7d661 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -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 diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 02f0916de0e..5221679e6cd 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -169,7 +169,7 @@ fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions { } } - return opts; + opts } fn runtest(test: &str, cratename: &str, cfgs: Vec, 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 { diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index a29566f7a07..4d1af162272 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -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,