(bytes: &[u8])
| 63 | } |
| 64 | |
| 65 | fn sections(bytes: &[u8]) -> Result<(usize, usize, usize, u32)> { |
| 66 | let mut input = bytes; |
| 67 | let mut reader = ChangeReader::open(&mut input)?; |
| 68 | let version = reader.file_header().version; |
| 69 | let mut semantic = 0; |
| 70 | let mut content = 0; |
| 71 | let mut graph = 0; |
| 72 | while let Some(section) = reader.next_section()? { |
| 73 | match section.section_type { |
| 74 | SectionType::Semantic => semantic += section.compressed_size as usize, |
| 75 | SectionType::Content => content += section.compressed_size as usize, |
| 76 | SectionType::Graph => graph += section.compressed_size as usize, |
| 77 | _ => {} |
| 78 | } |
| 79 | } |
| 80 | reader.verify()?; |
| 81 | Ok((semantic, content, graph, version)) |
| 82 | } |
| 83 | |
| 84 | fn measure(path: &Path) -> Result<Row> { |
| 85 | let original = fs::read(path)?; |
no test coverage detected