Commit Graph

6 Commits

Author SHA1 Message Date
David Tolnay
df39ac67d6 rust: Remove extern crate from common/rust
Summary:
This diff removes all occurrences of `extern crate` from //fbcode/common/rust// except within files included into bindgen code which are forced to use 2015 edition.

`#[macro_use]` attributes are replaced by 2018-style individual `use` of macros.

Reviewed By: jsgf

Differential Revision: D16179130

fbshipit-source-id: 25771eaec8e38043bfa1f9be267dc185758cd2d7
2019-07-10 11:58:48 -07:00
Pedro Rittner
6163109bcb rust/netstring: convert to Rust 2018
Summary: Test converting a small crate to Rust 2018

Reviewed By: StanislavGlebik

Differential Revision: D13606743

fbshipit-source-id: 5d09105d6918951dd190b63797f20acb1391ab9b
2019-02-12 08:43:24 -08:00
Jeremy Fitzhardinge
75b83935f8 rust/netstring: move encode and decode into separate modules.
Summary: Pure code motion

Reviewed By: farnz

Differential Revision: D9780345

fbshipit-source-id: dd743f4cf4a16712114af9a098b78aea02a2179d
2018-09-12 20:37:41 -07:00
Jeremy Fitzhardinge
48773d7c76 rust/netstring: convert from error-chain to failure
Summary: Use failure rather than error-chain for errors.

Reviewed By: StanislavGlebik

Differential Revision: D9780341

fbshipit-source-id: 4d41855093cf812e83b6c348a7499e85d9472daf
2018-09-12 20:37:41 -07:00
Jeremy Fitzhardinge
908adb73fa rust/netstring: refactor decoder into its own function
Summary:
Split the decoder out into its own function. This can handle partial results,
but the Decoder trait API cannot, so make sure the Decoder still only returns
complete results.

Reviewed By: farnz

Differential Revision: D9780342

fbshipit-source-id: b2439cba95b1e42444adbf2ee4b6e3792703a188
2018-09-12 20:37:41 -07:00
Lukas Piatkowski
b03d5cf630 'Re-sync with internal repository' 2018-07-26 09:09:45 -07:00