Skip to content

Commit

Permalink
labels: default to empty if no labels are passed
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin Beckers <[email protected]>
  • Loading branch information
embik committed Dec 3, 2023
1 parent 0058823 commit 82233b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/metadata/labels.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::metadata::ConfigMetadata;
use anyhow::{anyhow, bail, Result};
use anyhow::{bail, Result};
use std::{collections::BTreeMap, error::Error};

use clap::ArgMatches;
Expand All @@ -23,7 +23,7 @@ pub fn collect_from_args(matches: &ArgMatches, id: &str) -> Result<BTreeMap<Stri

matches
.get_many::<(String, String)>(id)
.ok_or_else(|| anyhow!("failed to parse labels"))?
.unwrap_or_default()
.for_each(|(key, value)| {
map.insert(key.clone(), value.clone());
});
Expand Down

0 comments on commit 82233b6

Please sign in to comment.