refactor: Update container remove leading '/'

This commit is contained in:
Jack Wills
2022-09-05 08:28:33 -04:00
parent bfc9cf9b39
commit 832e9782d7
+7 -9
View File
@@ -440,17 +440,15 @@ impl AppData {
for i in containers.iter() { for i in containers.iter() {
if let Some(id) = i.id.as_ref() { if let Some(id) = i.id.as_ref() {
// maybe if no name then continue? // maybe if no name then continue?
let name = i.names.as_ref().map_or("".to_owned(), |f|f.get(0).map_or("".to_owned(), |f|f.clone())); let name = i.names.as_ref().map_or("".to_owned(), |f|f.get(0).map_or("".to_owned(), |f|{
// if let Some(c) = name.chars().next() { let mut n = f.clone();
// if c == '/' { if n.starts_with('/') {
// name.remove(0); n.remove(0);
// } }
// } n
}));
let state = State::from(i.state.as_ref().map_or("dead".to_owned(), |f|f.trim().to_owned())); let state = State::from(i.state.as_ref().map_or("dead".to_owned(), |f|f.trim().to_owned()));
let status = i.status.as_ref().map_or("".to_owned(), |f| f.trim().to_owned()); let status = i.status.as_ref().map_or("".to_owned(), |f| f.trim().to_owned());
let image = i.image.as_ref().map_or("".to_owned(), |f|f.clone()); let image = i.image.as_ref().map_or("".to_owned(), |f|f.clone());