pub fn option_or_result_arg_ty<'tcx>( cx: &LateContext<'tcx>, ty: Ty<'tcx>, ) -> Option<Ty<'tcx>>
Check if ty is an Option<T> or a Result<T, E> and return its argument type (T) if it is.
ty
Option<T>
Result<T, E>
T