Skip to content

Commit a400ccc

Browse files
committed
Cleanup return statements.
1 parent 6d08949 commit a400ccc

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

src/librustdoc/clean/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ fn filter_non_trait_generics(trait_did: DefId, mut g: clean::Generics)
577577
_ => true,
578578
}
579579
});
580-
return g;
580+
g
581581
}
582582

583583
/// Supertrait bounds for a trait are also listed in the generics coming from

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ impl Lifetime {
764764
pub fn get_ref<'a>(&'a self) -> &'a str {
765765
let Lifetime(ref s) = *self;
766766
let s: &'a str = s;
767-
return s;
767+
s
768768
}
769769

770770
pub fn statik() -> Lifetime {
@@ -1129,7 +1129,7 @@ pub struct FnDecl {
11291129

11301130
impl FnDecl {
11311131
pub fn has_self(&self) -> bool {
1132-
return self.inputs.values.len() > 0 && self.inputs.values[0].name == "self";
1132+
self.inputs.values.len() > 0 && self.inputs.values[0].name == "self"
11331133
}
11341134

11351135
pub fn self_type(&self) -> Option<SelfTy> {

src/librustdoc/clean/simplify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn ty_params(mut params: Vec<clean::TyParam>) -> Vec<clean::TyParam> {
141141
for param in &mut params {
142142
param.bounds = ty_bounds(mem::replace(&mut param.bounds, Vec::new()));
143143
}
144-
return params;
144+
params
145145
}
146146

147147
fn ty_bounds(bounds: Vec<clean::TyParamBound>) -> Vec<clean::TyParamBound> {

src/librustdoc/html/render.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ fn write_shared(cx: &Context,
722722
ret.push(line.to_string());
723723
}
724724
}
725-
return Ok(ret);
725+
Ok(ret)
726726
}
727727

728728
// Update the search index
@@ -1208,7 +1208,7 @@ impl DocFolder for Cache {
12081208
self.seen_mod = orig_seen_mod;
12091209
self.stripped_mod = orig_stripped_mod;
12101210
self.parent_is_trait_impl = orig_parent_is_trait_impl;
1211-
return ret;
1211+
ret
12121212
}
12131213
}
12141214

@@ -1249,7 +1249,7 @@ impl Context {
12491249
self.dst = prev;
12501250
self.current.pop().unwrap();
12511251

1252-
return ret;
1252+
ret
12531253
}
12541254

12551255
/// Main method for rendering a crate.
@@ -1450,7 +1450,7 @@ impl Context {
14501450
for (_, items) in &mut map {
14511451
items.sort();
14521452
}
1453-
return map;
1453+
map
14541454
}
14551455
}
14561456

@@ -1647,7 +1647,7 @@ fn full_path(cx: &Context, item: &clean::Item) -> String {
16471647
let mut s = cx.current.join("::");
16481648
s.push_str("::");
16491649
s.push_str(item.name.as_ref().unwrap());
1650-
return s
1650+
s
16511651
}
16521652

16531653
fn shorter<'a>(s: Option<&'a str>) -> String {

src/librustdoc/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,14 @@ pub fn main_args(args: &[String]) -> isize {
288288
passes.into_iter().collect(),
289289
css_file_extension,
290290
renderinfo)
291-
.expect("failed to generate documentation")
291+
.expect("failed to generate documentation");
292+
0
292293
}
293294
Some(s) => {
294295
println!("unknown output format: {}", s);
295-
return 1;
296+
1
296297
}
297298
}
298-
299-
return 0;
300299
}
301300

302301
/// Looks inside the command line arguments to extract the relevant input format

src/librustdoc/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions {
169169
}
170170
}
171171

172-
return opts;
172+
opts
173173
}
174174

175175
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,
363363

364364
info!("final test program: {}", prog);
365365

366-
return prog
366+
prog
367367
}
368368

369369
fn partition_source(s: &str) -> (String, String) {
@@ -387,7 +387,7 @@ fn partition_source(s: &str) -> (String, String) {
387387
}
388388
}
389389

390-
return (before, after);
390+
(before, after)
391391
}
392392

393393
pub struct Collector {

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
328328
_ => false,
329329
};
330330
self.view_item_stack.remove(&def_node_id);
331-
return ret;
331+
ret
332332
}
333333

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

0 commit comments

Comments
 (0)