diff options
| author | diogo464 <[email protected]> | 2024-10-08 21:32:18 +0000 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2024-10-08 21:32:18 +0000 |
| commit | 204f9bd7a39b2d2050d56bf5471bdd8260f9d53d (patch) | |
| tree | fd69ba3c56866ec13689d5fee0c6ee555ccbe291 /src | |
| parent | 735dc15387b7dbbb81cde73ac567eecef5229806 (diff) | |
compile on stable0.3.1
Diffstat (limited to 'src')
| -rw-r--r-- | src/dotup/mod.rs | 15 | ||||
| -rw-r--r-- | src/main.rs | 3 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/dotup/mod.rs b/src/dotup/mod.rs index 4002f93..7c0c035 100644 --- a/src/dotup/mod.rs +++ b/src/dotup/mod.rs | |||
| @@ -313,13 +313,16 @@ fn insert_config_group( | |||
| 313 | actions: Default::default(), | 313 | actions: Default::default(), |
| 314 | }; | 314 | }; |
| 315 | 315 | ||
| 316 | for item in group_cfg | ||
| 317 | .items | ||
| 318 | .extract_if(|item| std::matches!(item, cfg::GroupItem::Action(_))) | ||
| 319 | { | 316 | { |
| 320 | if let cfg::GroupItem::Action(action) = item { | 317 | let mut idx = 0; |
| 321 | let action = convert_config_action(&dotup.context, action)?; | 318 | while idx < group_cfg.items.len() { |
| 322 | group.actions.push(action); | 319 | if let cfg::GroupItem::Action(action) = &group_cfg.items[idx] { |
| 320 | let action = convert_config_action(&dotup.context, action.clone())?; | ||
| 321 | group.actions.push(action.clone()); | ||
| 322 | group_cfg.items.remove(idx); | ||
| 323 | } else { | ||
| 324 | idx += 1; | ||
| 325 | } | ||
| 323 | } | 326 | } |
| 324 | } | 327 | } |
| 325 | 328 | ||
diff --git a/src/main.rs b/src/main.rs index 383de31..4f38388 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -1,6 +1,3 @@ | |||
| 1 | #![feature(extract_if)] | ||
| 2 | #![feature(io_error_other)] | ||
| 3 | |||
| 4 | pub mod dotup; | 1 | pub mod dotup; |
| 5 | 2 | ||
| 6 | use std::path::PathBuf; | 3 | use std::path::PathBuf; |
