File tree 1 file changed +14
-7
lines changed
src/cargo/sources/registry
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,20 @@ impl<'cfg> RegistryIndex<'cfg> {
115
115
// This loop tries all possible combinations of
116
116
// hyphen and underscores to find the uncanonicalized one.
117
117
for hyphen_combination_num in 0u16 ..( 1 << num_hyphen_underscore) {
118
- let path = raw_path. chars ( )
119
- . scan ( 0u32 , |s, c| if c == '_' || c == '-' {
120
- let out = Some ( if ( hyphen_combination_num & ( 1u16 << * s) ) > 0 { '_' } else { '-' } ) ;
121
- * s += 1 ;
122
- out
123
- } else {
124
- Some ( c)
118
+ let path = raw_path
119
+ . chars ( )
120
+ . scan ( 0u32 , |s, c| {
121
+ if c == '_' || c == '-' {
122
+ let out = Some ( if ( hyphen_combination_num & ( 1u16 << * s) ) > 0 {
123
+ '_'
124
+ } else {
125
+ '-'
126
+ } ) ;
127
+ * s += 1 ;
128
+ out
129
+ } else {
130
+ Some ( c)
131
+ }
125
132
} )
126
133
. collect :: < String > ( ) ;
127
134
let mut hit_closure = false ;
You can’t perform that action at this time.
0 commit comments