Skip to content

Commit 9849319

Browse files
authored
Rollup merge of rust-lang#139662 - nnethercote:tweak-DefPathData, r=compiler-errors
Tweak `DefPathData` Some improvements in and around `DefPathData`, following on from rust-lang#137977. r? `@spastorino`
2 parents 65105f1 + 595c8f9 commit 9849319

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_utils/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3504,7 +3504,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35043504
// a::b::c ::d::sym refers to
35053505
// e::f::sym:: ::
35063506
// result should be super::super::super::super::e::f
3507-
if let DefPathData::TypeNs(Some(s)) = l {
3507+
if let DefPathData::TypeNs(s) = l {
35083508
path.push(s.to_string());
35093509
}
35103510
if let DefPathData::TypeNs(_) = r {
@@ -3515,7 +3515,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35153515
// a::b::sym:: :: refers to
35163516
// c::d::e ::f::sym
35173517
// when looking at `f`
3518-
Left(DefPathData::TypeNs(Some(sym))) => path.push(sym.to_string()),
3518+
Left(DefPathData::TypeNs(sym)) => path.push(sym.to_string()),
35193519
// consider:
35203520
// a::b::c ::d::sym refers to
35213521
// e::f::sym:: ::
@@ -3529,7 +3529,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35293529
// `super` chain would be too long, just use the absolute path instead
35303530
once(String::from("crate"))
35313531
.chain(to.data.iter().filter_map(|el| {
3532-
if let DefPathData::TypeNs(Some(sym)) = el.data {
3532+
if let DefPathData::TypeNs(sym) = el.data {
35333533
Some(sym.to_string())
35343534
} else {
35353535
None

0 commit comments

Comments
 (0)