Skip to main content

default_shift_cycle

Function default_shift_cycle 

Source
pub fn default_shift_cycle() -> Vec<ShiftType>
Expand description

Returns the default 42-day shift cycle.

The sequence (in Chinese notation):

早早中中休夜夜休休早早中中休夜休休休早早中休夜夜休休休早中中休夜夜休休学学学学学休休

Must match Android ShiftCycleConfig.SHIFT_CYCLE exactly.

use shift_algorithm::cycle::default_shift_cycle;
use shift_algorithm::ShiftType;

let cycle = default_shift_cycle();
assert_eq!(cycle.len(), 42);
assert_eq!(cycle[0], ShiftType::Morning);
assert_eq!(cycle[41], ShiftType::Rest);