diff options
Diffstat (limited to 'src/container.rs')
-rw-r--r-- | src/container.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/container.rs b/src/container.rs index 2b3ee84..e73abf5 100644 --- a/src/container.rs +++ b/src/container.rs @@ -512,11 +512,8 @@ impl ContainerListOptionsBuilder { ContainerFilter::LabelName(n) => ("label", n), ContainerFilter::Label(n, v) => ("label", format!("{}={}", n, v)), }; - if let Some(values) = param.get_mut(key) { - values.push(value); - } else { - param.insert(key, vec![value]); - } + + param.entry(key).or_insert(Vec::new()).push(value); } // structure is a a json encoded object mapping string keys to a list // of string values |