Skip to content

Commit d0d9377

Browse files
committed
cargo +stable fmt
1 parent 3b495a5 commit d0d9377

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/cargo/sources/registry/index.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,20 @@ impl<'cfg> RegistryIndex<'cfg> {
115115
// This loop tries all possible combinations of
116116
// hyphen and underscores to find the uncanonicalized one.
117117
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+
}
125132
})
126133
.collect::<String>();
127134
let mut hit_closure = false;

0 commit comments

Comments
 (0)