decl: &hir::FnDecl<'tcx>,
args: Arguments,
) -> FnDecl {
- FnDecl { inputs: args, output: decl.output.clean(cx), c_variadic: decl.c_variadic }
+ let output = match decl.output {
+ hir::FnRetTy::Return(typ) => Return(clean_ty(typ, cx)),
+ hir::FnRetTy::DefaultReturn(..) => DefaultReturn,
+ };
+ FnDecl { inputs: args, output, c_variadic: decl.c_variadic }
}
fn clean_fn_decl_from_did_and_sig<'tcx>(
}
}
-impl<'tcx> Clean<'tcx, FnRetTy> for hir::FnRetTy<'tcx> {
- fn clean(&self, cx: &mut DocContext<'tcx>) -> FnRetTy {
- match *self {
- Self::Return(typ) => Return(clean_ty(typ, cx)),
- Self::DefaultReturn(..) => DefaultReturn,
- }
- }
-}
-
impl<'tcx> Clean<'tcx, Path> for hir::TraitRef<'tcx> {
fn clean(&self, cx: &mut DocContext<'tcx>) -> Path {
let path = clean_path(self.path, cx);