Add very short info

This commit is contained in:
2022-11-16 17:20:26 +01:00
parent 1b68728e3e
commit 8a1b95ccba
2 changed files with 11 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
//println!("{:#?}", resp);
//println!("{}", resp.today());
for a in resp.today().iter() {
a.print_short_info();
a.print_very_short_info();
}
}

View File

@@ -115,6 +115,16 @@ impl Menu {
pub fn print_short_info(&self) {
println!("{}: {}, {}", self.menu_line, self.menu.join(", "), self.student_price);
}
pub fn print_very_short_info(&self) {
if let Some(name) = self.menu.first() {
println!("{}", name);
}
}
pub fn get_short_info(&self) -> (&str, String, &str) {
(&self.menu_line, self.menu.join(", "), &self.student_price)
}
}
#[derive(Debug, Serialize, Deserialize)]