Add very short info
This commit is contained in:
@@ -11,7 +11,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
//println!("{:#?}", resp);
|
//println!("{:#?}", resp);
|
||||||
//println!("{}", resp.today());
|
//println!("{}", resp.today());
|
||||||
for a in resp.today().iter() {
|
for a in resp.today().iter() {
|
||||||
a.print_short_info();
|
a.print_very_short_info();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
10
src/mensa.rs
10
src/mensa.rs
@@ -115,6 +115,16 @@ impl Menu {
|
|||||||
pub fn print_short_info(&self) {
|
pub fn print_short_info(&self) {
|
||||||
println!("{}: {}, {}€", self.menu_line, self.menu.join(", "), self.student_price);
|
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)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
Reference in New Issue
Block a user