Skip to content

Commit cc50d7f

Browse files
authored
Merge pull request #539 from ratmice/bincode_config
Experiment with bincode variable width encoding config
2 parents 8cd38e8 + 75bae22 commit cc50d7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lrpar/src/lib/ctbuilder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,8 +981,8 @@ where
981981
_ => unreachable!(),
982982
};
983983

984-
let grm_data = encode_to_vec(grm, bincode::config::legacy())?;
985-
let stable_data = encode_to_vec(stable, bincode::config::legacy())?;
984+
let grm_data = encode_to_vec(grm, bincode::config::standard())?;
985+
let stable_data = encode_to_vec(stable, bincode::config::standard())?;
986986
Ok(quote! {
987987
const __GRM_DATA: &[u8] = &[#(#grm_data,)*];
988988
const __STABLE_DATA: &[u8] = &[#(#stable_data,)*];
@@ -1340,8 +1340,8 @@ pub fn _reconstitute<StorageT: Decode<()> + Hash + PrimInt + Unsigned + 'static>
13401340
grm_buf: &[u8],
13411341
stable_buf: &[u8],
13421342
) -> (YaccGrammar<StorageT>, StateTable<StorageT>) {
1343-
let (grm, _) = decode_from_slice(grm_buf, bincode::config::legacy()).unwrap();
1344-
let (stable, _) = decode_from_slice(stable_buf, bincode::config::legacy()).unwrap();
1343+
let (grm, _) = decode_from_slice(grm_buf, bincode::config::standard()).unwrap();
1344+
let (stable, _) = decode_from_slice(stable_buf, bincode::config::standard()).unwrap();
13451345
(grm, stable)
13461346
}
13471347

0 commit comments

Comments
 (0)