in gazebo_lint/src/lib.rs [511:538]
fn check_qualify_anyhow(cx: &LateContext, item: &Item) {
if let ItemKind::Use(path, kind) = &item.kind {
if let Some(res) = unpack_non_local(path.res) {
match kind {
UseKind::Glob => {
if let Some(anyhow_path) = clippy::path_to_res(cx, &["anyhow"]) {
if anyhow_path == res {
emit_lint(cx, GAZEBO_LINT_ANYHOW_QUALIFY, item.span)
}
}
}
UseKind::Single => {
if let Some(anyhow_path) = clippy::path_to_res(cx, &["anyhow", "Result"]) {
if anyhow_path == res {
emit_lint(cx, GAZEBO_LINT_ANYHOW_QUALIFY, item.span)
}
}
if let Some(anyhow_path) = clippy::path_to_res(cx, &["anyhow", "Error"]) {
if anyhow_path == res {
emit_lint(cx, GAZEBO_LINT_ANYHOW_QUALIFY, item.span)
}
}
}
_ => {}
};
}
}
}