Commit Graph

5 Commits

Author SHA1 Message Date
David Tolnay
97c13edcc7 Delete lines of the form "use [a-z_]+;"
Summary: I think these are left over from pre-2018 code where they may have been necessary. In 2018 edition, import paths in `use` always begin with a crate name or `crate`/`super`/`self`, so `use $ident;` always refers to a crate. Since extern crates are always in scope in every module, `use $ident` does nothing.

Reviewed By: Imxset21

Differential Revision: D17290473

fbshipit-source-id: 23d86e5d0dcd5c2d4e53c7a36b4267101dd4b45c
2019-09-10 15:06:37 -07:00
Jun Wu
3f459fc3ef mincode: add serialize_into API
Summary:
The existing API is a bit harder to use - the caller must provide a
`&mut Vec<u8>`. Rename that to `serialize_into` and provide a `serialize` that
creates the `Vec<u8>` automatically. This is more consistent with the `bincode`
API interface.

Reviewed By: kulshrax

Differential Revision: D17087349

fbshipit-source-id: 0307b85818ab0f7549a264b41a08e53f7573372e
2019-09-06 13:13:48 -07:00
Jun Wu
e92da70818 mincode: add a basic test
Summary: Add a basic test to ensure mincode is somehow working.

Reviewed By: kulshrax

Differential Revision: D17087350

fbshipit-source-id: efa5d18e579688521e91fe28ee67f1d7f7c15558
2019-09-06 13:13:48 -07:00
Jun Wu
234eefc294 mincode: use vlqencoding for integers
Summary:
This completes the mincode implementation.

I later learned wez has published a very similar crate at
https://github.com/wez/varbincode. Great minds think alike.

Benchmark with varbincode shows this crate is a little bit faster
(varbincode is not in tp2 so we cannot easily add it to benchmark now).

Reviewed By: kulshrax

Differential Revision: D17087351

fbshipit-source-id: 179392029e7b34d7cb92f00b7926ee6be4722d09
2019-09-06 13:13:48 -07:00
Jun Wu
305d739ac3 mincode: initial boilerplate
Summary:
Initialize the mincode library using serde-rs/bench.  See the previous diff for
context.

Reviewed By: kulshrax

Differential Revision: D17087354

fbshipit-source-id: 6e9b6376b8aaec61e85a76320933b63d0ba1b698
2019-09-06 13:13:47 -07:00