livesplit-core
livesplit-core copied to clipboard
Rework Run::current_split_index
It should either return None or a valid index into the Run. I don't think it's a good idea that we are returning out of bounds indices here. @wooferzfg thoughts?
Yeah, using an out of bounds index for when the run is unstarted or ended is really hacky because we can get the same information from the timer phase. We just need to make sure that there isn't any code that's relying on the current split index being an out of bounds value.
I think we might even want to turn TimerPhase into:
enum AttemptState {
Unstarted,
Active {
index: usize,
paused: bool,
},
Ended,
}
or something similar.