pub fn next_action(&self) -> Option<AreaAction> {
        self.mine_count.exact_count().and_then(|count| match count {
            0 => Some(AreaAction::Open),
            _ if count == self.positions.len() => Some(AreaAction::Flag),
            _ => None,
        })
    }
/// Returns the next possible action for [`Area`] if one exists.
///
/// # Examples
/// ```
/// use std::collections::HashSet;
/// use mineraker::area::{Area, AreaAction};
/// use mineraker::position::Position;
///
/// let positions = HashSet::from([
///     Position::new(1, 0),
///     Position::new(2, 0),
///     Position::new(3, 0),
/// ]);
///
/// let area = Area::new(positions.clone(), 0);
/// assert_eq!(area.next_action(), Some(AreaAction::Open));
/// let area2 = Area::new(positions.clone(), 3);
/// assert_eq!(area2.next_action(), Some(AreaAction::Flag));
/// let area3 = Area::new(positions.clone(), 1);
/// assert_eq!(area3.next_action(), None);
/// let area4 = Area::new(positions.clone(), 1..=3);
/// assert_eq!(area4.next_action(), None);
/// ```
Returns the next possible action for [`Area`] if one exists.
Returns the next possible action for [ ` Area ` ] if one exists .
pub fn next_action(&self) -> Option<AreaAction> {
        self.mine_count.exact_count().and_then(|count| match count {
            0 => Some(AreaAction::Open),
            _ if count == self.positions.len() => Some(AreaAction::Flag),
            _ => None,
        })
    }
pub fn next_action ( & self ) -> Option < AreaAction > { self . mine_count . exact_count ( ) . and_then ( | count | match count { 0 => Some ( AreaAction :: Open ) , _ if count == self . positions . len ( ) => Some ( AreaAction :: Flag ) , _ => None , } ) }
Returns the next possible action for [`Area`] if one exists.
Returns the next possible action for [ ` Area ` ] if one exists .
&self
&self
examples
```
use std::collections::HashSet;
use mineraker::area::{Area, AreaAction};
use mineraker::position::Position.



let area = Area::new(positions.clone(), 0);
assert_eq!(area.next_action(), Some(AreaAction::Open));
let area2 = Area::new(positions.clone(), 3);
assert_eq!(area2.next_action(), Some(AreaAction::Flag));
let area3 = Area::new(positions.clone(), 1);
assert_eq!(area3.next_action(), None);
let area4 = Area::new(positions.clone(), 1..=3);
assert_eq!(area4.next_action(), None);
```
` ` ` use std :: collections :: HashSet ; use mineraker :: area :: { Area AreaAction } ; use mineraker :: position :: Position . let area = Area :: new ( positions . clone () 0 ) ; assert_eq! ( area . next_action () Some ( AreaAction :: Open )) ; let area2 = Area :: new ( positions . clone () 3 ) ; assert_eq! ( area2 . next_action () Some ( AreaAction :: Flag )) ; let area3 = Area :: new ( positions . clone () 1 ) ; assert_eq! ( area3 . next_action () None ) ; let area4 = Area :: new ( positions . clone () 1 .. = 3 ) ; assert_eq! ( area4 . next_action () None ) ; ` ` `