File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -670,20 +670,13 @@ pub fn path_name_eq(a : &ast::Path, b : &ast::Path) -> bool {
670
670
671
671
// are two arrays of segments equal when compared unhygienically?
672
672
pub fn segments_name_eq ( a : & [ ast:: PathSegment ] , b : & [ ast:: PathSegment ] ) -> bool {
673
- if a. len ( ) != b. len ( ) {
674
- false
675
- } else {
676
- for ( idx, seg) in a. iter ( ) . enumerate ( ) {
677
- if seg. identifier . name != b[ idx] . identifier . name
678
- // FIXME #7743: ident -> name problems in lifetime comparison?
679
- // can types contain idents?
680
- || seg. parameters != b[ idx] . parameters
681
- {
682
- return false ;
683
- }
684
- }
685
- true
686
- }
673
+ a. len ( ) == b. len ( ) &&
674
+ a. iter ( ) . zip ( b. iter ( ) ) . all ( |( s, t) | {
675
+ s. identifier . name == t. identifier . name &&
676
+ // FIXME #7743: ident -> name problems in lifetime comparison?
677
+ // can types contain idents?
678
+ s. parameters == t. parameters
679
+ } )
687
680
}
688
681
689
682
/// Returns true if this literal is a string and false otherwise.
You can’t perform that action at this time.
0 commit comments