File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
tooling/cli/src/interface/rust Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' cli.rs ' : ' patch'
3+ ' cli.js ' : ' patch'
4+ ---
5+
6+ Fixes Cargo.toml feature rewriting.
Original file line number Diff line number Diff line change @@ -146,14 +146,15 @@ fn write_features(
146146 }
147147
148148 // remove features that shouldn't be in the manifest anymore
149- let mut i = 0 ;
150- while i < features_array. len ( ) {
151- if let Some ( f) = features_array. get ( i) . and_then ( |f| f. as_str ( ) ) {
149+ let mut i = features_array. len ( ) ;
150+ while i != 0 {
151+ let index = i - 1 ;
152+ if let Some ( f) = features_array. get ( index) . and_then ( |f| f. as_str ( ) ) {
152153 if !features. contains ( f) {
153- features_array. remove ( i ) ;
154+ features_array. remove ( index ) ;
154155 }
155156 }
156- i + = 1 ;
157+ i - = 1 ;
157158 }
158159 } else {
159160 * manifest_features = Item :: Value ( Value :: Array ( toml_array ( features) ) ) ;
You can’t perform that action at this time.
0 commit comments