Restore more of the blob window and add is_coding helper

This commit is contained in:
Stephen Akridge
2018-06-01 12:49:47 -07:00
committed by Greg Fitzgerald
parent 5711fb9969
commit b845245614
3 changed files with 107 additions and 74 deletions

View File

@@ -313,6 +313,15 @@ impl Blob {
Ok(())
}
pub fn is_coding(&self) -> bool {
return (self.get_flags().unwrap() & BLOB_FLAG_IS_CODING) != 0;
}
pub fn set_coding(&mut self) -> Result<()> {
let flags = self.get_flags().unwrap();
self.set_flags(flags | BLOB_FLAG_IS_CODING)
}
pub fn data(&self) -> &[u8] {
&self.data[BLOB_FLAGS_END..]
}