backend #4
@ -17,12 +17,12 @@ impl BingoSquare {
|
|||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
pub struct Meta {
|
pub struct Meta {
|
||||||
name: String,
|
name: String,
|
||||||
reason: String,
|
description: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Meta {
|
impl Meta {
|
||||||
pub fn new(name: String, reason: String) -> Meta {
|
pub fn new(name: String, description: String) -> Meta {
|
||||||
Meta { name, reason }
|
Meta { name, description }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +35,7 @@ pub struct BingoPool {
|
|||||||
impl fmt::Display for BingoPool {
|
impl fmt::Display for BingoPool {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(f, "Name: {}\n", self.meta.name).unwrap();
|
write!(f, "Name: {}\n", self.meta.name).unwrap();
|
||||||
|
write!(f, "Description: {}\n\n", self.meta.description).unwrap();
|
||||||
for square in &self.squares {
|
for square in &self.squares {
|
||||||
write!(f, "Square: {}\n", square.option).unwrap();
|
write!(f, "Square: {}\n", square.option).unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
[meta]
|
[meta]
|
||||||
name = 'Test Bingo'
|
name = 'Test Bingo'
|
||||||
reason = 'Because its fucking funny'
|
description = 'Because its fucking funny'
|
||||||
|
|
||||||
[[squares]]
|
[[squares]]
|
||||||
option = 'This is a test square'
|
option = 'Code compiles first try and no one believes you'
|
||||||
|
|
||||||
[[squares]]
|
[[squares]]
|
||||||
option = 'This is a second test square'
|
option = 'There isnt a crate for that already'
|
||||||
|
|
||||||
[[squares]]
|
[[squares]]
|
||||||
option = 'This is a third test square'
|
option = 'Someone tells you to use JS'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user