Parse int JSON as true only if == 1
commitc92e1e1beb57090f49b8aa1889c016e09f5bd20c
authorLeo Osvald <leoo@fb.com>
Wed, 22 Apr 2020 16:30:44 +0000 (22 09:30 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 22 Apr 2020 16:47:16 +0000 (22 09:47 -0700)
tree02ed5a0d949ee5b666bb1aa5316bdf12dc1c0ed6
parente5873c3da6352b52e08d21b7068456705bb70b7d
Parse int JSON as true only if == 1

Summary:
Previous OCaml implementation treated some bool options
that were passed an integer JSON value >1 as true, so initial Rust port
had to be more conservative, which led to inconsistencies
(since most bool options in OCaml impl were true only if =1).

Now that the OCaml implementation is fixed to consistently cast int to bool
or JSON int-ish values (integers or string containing digits only),
make the Rust implementation equally strict and consistent.

Reviewed By: shiqicao

Differential Revision: D21171681

fbshipit-source-id: e4313a914456f093a815dade482709a9027e99b6
hphp/hack/src/hhbc/options.rs