lzma 0.1.0

LZMA format handling.
pub enum State {
	Literal(u32),
	Match(u32),
	Repetition(u32),
	ShortRepetition(u32),
}

impl State {
	pub fn update(self) -> u32 {
		match self {
			State::Literal(value) if value < 4  => 0,
			State::Literal(value) if value < 10 => value - 3,
			State::Literal(value)               => value - 6,

			State::Match(value) if value < 7 => 7,
			State::Match(_)                  => 10,

			State::Repetition(value) if value < 7 => 8,
			State::Repetition(_)                  => 11,

			State::ShortRepetition(value) if value < 7 => 9,
			State::ShortRepetition(_)                  => 11,
		}
	}
}