You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: unnecessary_fallible_conversions.rs
    path of file: ./repos/rust-clippy/clippy_lints/src/methods
    
    the code of the file until where you have to start completion: use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::get_parent_expr;
use clippy_utils::ty::implements_trait;
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind, QPath};
use rustc_lint::LateContext;
use rustc_middle::ty;
use rustc_middle::ty::print::with_forced_trimmed_paths;
use rustc_span::{sym, Span};

use super::UNNECESSARY_FALLIBLE_CONVERSIONS;

#[derive(Copy, Clone)]
enum SpansKind {
    TraitFn { trait_span: Span, fn_span: Span },
    Fn { fn_span: Span },
}

/// What function is being called and whether that call is written as a method call or a function
/// call
#[derive(Copy, Clone)]
#[expect(clippy::enum_variant_names)]
enum FunctionKind {
    /// `T::try_from(U)`
    TryFromFunction(Option<SpansKind>),
    /// `t.try_into()`
    TryIntoMethod,
    /// `U::try_into(t)`
    TryIntoFunction(Option<SpansKind>),
}

impl FunctionKind {
    fn appl_sugg(&self, parent_unwrap_call: Option<
    
pub(super) fn check_function(cx: &LateContext<'_>, expr: &Expr<'_>, callee: &Expr<'_>) {
    if let ExprKind::Path(ref qpath) = callee.kind
        && let Some(item_def_id) = cx.qpath_res(qpath, callee.hir_id).opt_def_id()
        && let Some(trait_def_id) = cx.tcx.trait_of_item(item_def_id)
    {
        let qpath_spans = match qpath {
            QPath::Resolved(_, path) => {
                if let [trait_seg, fn_seg] = path.segments {
                    Some(SpansKind::TraitFn {
                        trait_span: trait_seg.ident.span,
                        fn_span: fn_seg.ident.span,
                    })
                } else {
                    None
                }
            },
            QPath::TypeRelative(_, seg) => Some(SpansKind::Fn {
                fn_span: seg.ident.span,
            }),
            QPath::LangItem(_, _) => unreachable!("`TryFrom` and `TryInto` are not lang items"),
        };

        check(
            cx,
            expr,
            cx.typeck_results().node_args(callee.hir_id),
            match cx.tcx.get_diagnostic_name(trait_def_id) {
                Some(sym::TryFrom) => FunctionKind::TryFromFunction(qpath_spans),
                Some(sym::TryInto) => FunctionKind::TryIntoFunction(qpath_spans),
                _ => return,
            },
            callee.span,
        );
    }
}