File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 44
55use crate :: { FormatVersion , TreeType } ;
66use byteorder:: { ReadBytesExt , WriteBytesExt } ;
7- use std:: { io:: Write , path:: Path } ;
7+ use std:: {
8+ io:: { Read , Write } ,
9+ path:: Path ,
10+ } ;
811
912pub struct Manifest {
1013 pub version : FormatVersion ,
@@ -27,7 +30,7 @@ impl Manifest {
2730 writer. write_u8 ( self . level_count ) ?;
2831
2932 writer. start ( "filter_hash_type" ) ?;
30- writer. write_u8 ( 0 ) ?; // 0 = XXH3
33+ writer. write_all ( b"xxh3" ) ?;
3134
3235 Ok ( ( ) )
3336 }
@@ -77,12 +80,17 @@ impl Manifest {
7780 . section ( b"filter_hash_type" )
7881 . expect ( "filter_hash_type section must exist in manifest" ) ;
7982
80- let mut reader = section. buf_reader ( path) ?;
81- reader. read_u8 ( ) ?
83+ section
84+ . buf_reader ( path) ?
85+ . bytes ( )
86+ . collect :: < Result < Vec < _ > , _ > > ( ) ?
8287 } ;
8388
8489 // Only one supported right now (and probably forever)
85- assert_eq ! ( 0 , filter_hash_type, "filter_hash_type should be XXH3" ) ;
90+ assert_eq ! (
91+ b"xxh3" , & * filter_hash_type,
92+ "filter_hash_type should be XXH3"
93+ ) ;
8694 }
8795
8896 Ok ( Self {
You can’t perform that action at this time.
0 commit comments