ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

use try_fold for resolving targets

+7 -8
+7 -8
crates/cli/src/apply.rs
··· 55 55 fn resolve_targets( 56 56 on: &[ApplyTarget], 57 57 modifiers: &mut SubCommandModifiers, 58 - ) -> (HashSet<String>, HashSet<Name>) { 59 - on.iter().fold( 58 + ) -> Result<(HashSet<String>, HashSet<Name>)> { 59 + on.iter().try_fold( 60 60 (HashSet::new(), HashSet::new()), 61 - |(mut tags, mut names), target| { 61 + |result, target| { 62 + let (mut tags, mut names) = result; 62 63 match target { 63 64 ApplyTarget::Tag(tag) => { 64 65 tags.insert(tag.clone()); ··· 67 68 names.insert(name.clone()); 68 69 } 69 70 ApplyTarget::Stdin => { 70 - // implies non_interactive 71 71 modifiers.non_interactive = true; 72 - 73 - let (found_tags, found_names) = read_apply_targets_from_stdin().unwrap(); 72 + let (found_tags, found_names) = read_apply_targets_from_stdin()?; 74 73 names.extend(found_names); 75 74 tags.extend(found_tags); 76 75 } 77 76 } 78 - (tags, names) 77 + Ok((tags, names)) 79 78 }, 80 79 ) 81 80 } ··· 110 109 { 111 110 let location = Arc::new(location); 112 111 113 - let (tags, names) = resolve_targets(&args.on, &mut modifiers); 112 + let (tags, names) = resolve_targets(&args.on, &mut modifiers)?; 114 113 115 114 let selected_names: Vec<_> = hive 116 115 .nodes