From bcd5764aa03e128e06c355272b7b81eac8d4501d Mon Sep 17 00:00:00 2001 From: stale Date: Sun, 29 May 2022 20:45:03 -0300 Subject: improved pubs listing, many minor fixes --- src/minesweeper.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/minesweeper.rs') diff --git a/src/minesweeper.rs b/src/minesweeper.rs index c81aa09..a494b94 100644 --- a/src/minesweeper.rs +++ b/src/minesweeper.rs @@ -3,6 +3,8 @@ use std::{ num::NonZeroUsize, }; use rand::{ thread_rng, Rng, distributions::Uniform }; +use serde::Serialize; + const HIDDEN_BIT: u8 = 1 << 7; pub const FLAGGED_BIT: u8 = 1 << 6; const CORRECT_BIT: u8 = 1 << 5; // grading for a rightly flagged mine @@ -29,7 +31,7 @@ pub struct Game { pub board_conf: BoardConf, } -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Serialize)] pub struct BoardConf { pub w: NonZeroUsize, pub h: NonZeroUsize, -- cgit v1.2.3