Skip to content

Commit

Permalink
Update container.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rakshith-ravi authored Apr 1, 2021
1 parent 217568e commit 01e5bd1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ pub enum ContainerFilter {
Status(String),
LabelName(String),
Label(String, String),
Name(String),
}

/// Builder interface for `ContainerListOptions`
Expand All @@ -463,6 +464,7 @@ impl ContainerListOptionsBuilder {
ContainerFilter::Status(s) => param.insert("status", vec![s]),
ContainerFilter::LabelName(n) => param.insert("label", vec![n]),
ContainerFilter::Label(n, v) => param.insert("label", vec![format!("{}={}", n, v)]),
ContainerFilter::Name(n) => param.insert("name", vec![n]),
};
}
// structure is a a json encoded object mapping string keys to a list
Expand Down Expand Up @@ -497,11 +499,6 @@ impl ContainerListOptionsBuilder {
self.params.insert("size", "true".to_owned());
self
}

pub fn name(&mut self, name: &str) -> &mut Self {
self.params.insert("name", name.to_owned());
self
}

pub fn build(&self) -> ContainerListOptions {
ContainerListOptions {
Expand Down

0 comments on commit 01e5bd1

Please sign in to comment.