chore: add use case for PathSegment::qualifying_trait

This commit is contained in:
Young-Flash 2023-11-17 21:31:33 +08:00
parent bc978217b3
commit 1cbda612bc

View File

@ -91,7 +91,7 @@ fn add_import(
) { ) {
if let Some(path_segment) = qualifier.segment() { if let Some(path_segment) = qualifier.segment() {
// for `<i32 as std::ops::Add>` // for `<i32 as std::ops::Add>`
let path_type = path_segment.syntax().children().filter_map(ast::PathType::cast).last(); let path_type = path_segment.qualifying_trait();
let import = match path_type { let import = match path_type {
Some(it) => { Some(it) => {
if let Some(path) = it.path() { if let Some(path) = it.path() {