20 lines
428 B
Rust
20 lines
428 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Guess {
|
|
pub map: String,
|
|
pub result: String,
|
|
}
|
|
|
|
impl Guess {
|
|
pub fn create(map: String, is_correct: bool) -> Guess {
|
|
Guess {
|
|
map,
|
|
result: match is_correct {
|
|
true => "correct".to_string(),
|
|
false => "incorrect".to_string(),
|
|
},
|
|
}
|
|
}
|
|
}
|