Convert an `Option ` to a `HashIndex`. - `None` → `HASH_INDEX_NONE` - `Some(hash)` → looked up in the dedup table
(&self, hash: &Option<Hash>)
| 251 | /// - `None` → `HASH_INDEX_NONE` |
| 252 | /// - `Some(hash)` → looked up in the dedup table |
| 253 | pub(super) fn hash_to_index(&self, hash: &Option<Hash>) -> FormatResult<HashIndex> { |
| 254 | match hash { |
| 255 | None => Ok(HASH_INDEX_NONE), |
| 256 | Some(h) => { |
| 257 | let bytes = h.as_bytes(); |
| 258 | self.table.require(bytes) |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | /// Convert a `HashIndex` to an `Option<Hash>`. |
| 264 | /// |
no test coverage detected