mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-03 08:36:07 +03:00
fix(cli): correctly remove Cargo features (#7013)
This commit is contained in:
parent
61e3ad89e9
commit
1253bbf7ae
6
.changes/fix-feature-removal.md
Normal file
6
.changes/fix-feature-removal.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'cli.rs': 'patch'
|
||||
'cli.js': 'patch'
|
||||
---
|
||||
|
||||
Fixes Cargo.toml feature rewriting.
|
@ -146,14 +146,15 @@ fn write_features(
|
||||
}
|
||||
|
||||
// remove features that shouldn't be in the manifest anymore
|
||||
let mut i = 0;
|
||||
while i < features_array.len() {
|
||||
if let Some(f) = features_array.get(i).and_then(|f| f.as_str()) {
|
||||
let mut i = features_array.len();
|
||||
while i != 0 {
|
||||
let index = i - 1;
|
||||
if let Some(f) = features_array.get(index).and_then(|f| f.as_str()) {
|
||||
if !features.contains(f) {
|
||||
features_array.remove(i);
|
||||
features_array.remove(index);
|
||||
}
|
||||
}
|
||||
i += 1;
|
||||
i -= 1;
|
||||
}
|
||||
} else {
|
||||
*manifest_features = Item::Value(Value::Array(toml_array(features)));
|
||||
|
Loading…
Reference in New Issue
Block a user