mark unsafe variables and substitute temporary variables in is/2 when appropriate (#1430)

This commit is contained in:
Mark Thom
2022-04-17 17:33:09 -06:00
parent 35b8f69f92
commit 66075bf45b
5 changed files with 45 additions and 45 deletions

View File

@@ -234,12 +234,22 @@ pub enum GenContext {
}
impl GenContext {
#[inline]
pub fn chunk_num(self) -> usize {
match self {
GenContext::Head => 0,
GenContext::Mid(cn) | GenContext::Last(cn) => cn,
}
}
#[inline]
pub fn is_last(self) -> bool {
if let GenContext::Last(_) = self {
true
} else {
false
}
}
}
#[bitfield]