diff --git a/src/widget/info.rs b/src/widget/info.rs index 8d2d7d3..51cb1d7 100644 --- a/src/widget/info.rs +++ b/src/widget/info.rs @@ -27,10 +27,12 @@ impl Info { .highlight_style(Style::default().bg(Color::Black)) } + /// set a text to display pub fn set_text(&mut self, info: &str) { self.info = String::from(info); } + /// print a text to display pub fn set_info(&mut self, text: &dyn std::fmt::Display) { self.info = format!("{}", text); } diff --git a/src/widget/service_switcher.rs b/src/widget/service_switcher.rs index 3946c73..d57046b 100644 --- a/src/widget/service_switcher.rs +++ b/src/widget/service_switcher.rs @@ -34,6 +34,7 @@ pub struct ServiceSwitcher { impl ServiceSwitcher { pub fn new(file: &Option) -> Option { + //gather possible filenames let mut file_list = vec![ PathBuf::from("docker-compose.yml"), PathBuf::from("docker-compose.yaml"), @@ -43,6 +44,7 @@ impl ServiceSwitcher { Some(file) => file_list.insert(0, file.clone()), } + //try filenames for file in file_list { let list = match File::open(&file) { Err(_) => continue,