remove unused return types such as empty Results or Options that would always be Some(..)
remove unused return type of dropck::check_drop_obligations() don't wrap return type in Option in get_macro_by_def_id() since we would always return Some(..) remove redundant return type of back::write::optimize() don't Option-wrap return type of compute_type_parameters() since we always return Some(..) don't return empty Result in assemble_generator_candidates() don't return empty Result in assemble_closure_candidates() don't return empty result in assemble_fn_pointer_candidates() don't return empty result in assemble_candidates_from_impls() don't return empty result in assemble_candidates_from_auto_impls() don't return emtpy result in assemble_candidates_for_trait_alias() don't return empty result in assemble_builtin_bound_candidates() don't return empty results in assemble_extension_candidates_for_traits_in_scope() and assemble_extension_candidates_for_trait() remove redundant wrapping of return type of StripItem::strip() since it always returns Some(..) remove unused return type of assemble_extension_candidates_for_all_traits()
This commit is contained in:
parent
b9c403be11
commit
e5ead5fc58
12 changed files with 56 additions and 81 deletions
|
|
@ -3,12 +3,12 @@ use crate::clean::*;
|
|||
crate struct StripItem(pub Item);
|
||||
|
||||
impl StripItem {
|
||||
crate fn strip(self) -> Option<Item> {
|
||||
crate fn strip(self) -> Item {
|
||||
match self.0 {
|
||||
Item { kind: box StrippedItem(..), .. } => Some(self.0),
|
||||
Item { kind: box StrippedItem(..), .. } => self.0,
|
||||
mut i => {
|
||||
i.kind = box StrippedItem(i.kind);
|
||||
Some(i)
|
||||
i
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ impl<'a> DocFolder for Stripper<'a> {
|
|||
let old = mem::replace(&mut self.update_retained, false);
|
||||
let ret = StripItem(self.fold_item_recur(i)).strip();
|
||||
self.update_retained = old;
|
||||
return ret;
|
||||
return Some(ret);
|
||||
}
|
||||
_ => return None,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ impl<'a> DocFolder for Stripper<'a> {
|
|||
|
||||
clean::StructFieldItem(..) => {
|
||||
if !i.visibility.is_public() {
|
||||
return StripItem(i).strip();
|
||||
return Some(StripItem(i).strip());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ impl<'a> DocFolder for Stripper<'a> {
|
|||
let old = mem::replace(&mut self.update_retained, false);
|
||||
let ret = StripItem(self.fold_item_recur(i)).strip();
|
||||
self.update_retained = old;
|
||||
return ret;
|
||||
return Some(ret);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue