Commit Graph

7 Commits

Author SHA1 Message Date
David Tolnay
e84e100f06 Delete extern crate lines
Summary:
`extern crate` is usually no longer needed in 2018 edition of Rust. This diff removes `extern crate` lines from fbcode where possible, replacing #[macro_use] with individual import of macros.

Before:

```
#[macro_use]
extern crate futures_ext;
extern crate serde_json;
```

After:

```
use futures_ext::try_boxfuture;
```

Reviewed By: Imxset21

Differential Revision: D17313537

fbshipit-source-id: 70462a2c161375017b77fa44aba166884ad2fdc3
2019-09-11 22:02:16 -07:00
Jun Wu
90e7f78e28 lib: drop extension-module-2-7 cpython feature
Summary:
`extension-module-2-7` should only be used for "extension modules". They change
link behavior and can cause issues. In our cases, only "python27-sys" is actually
used.

Reviewed By: farnz

Differential Revision: D16706183

fbshipit-source-id: cd2474556f92bb3697a2d209a790baf063195c50
2019-08-08 22:54:07 -07:00
Jorge Lopez Silva
a1fd50cc9b Upgrade smc/hg to cpython/python-sys 0.3
Summary: Bump cpython and python27-sys to 0.3.

Reviewed By: quark-zju

Differential Revision: D16634957

fbshipit-source-id: 9f6b45baf8098399109ad03bf440da42f4483fcb
2019-08-05 09:56:45 -07:00
Jun Wu
f23b457b54 cpython-failure: implement convertion from PyResult to Fallible
Summary:
This would be useful for functions that need the `Fallible` return type.

For convenience, it's round-tripable,  `py_result.into_fallible().map_pyerr(...)` is `py_result`.

Reviewed By: xavierd

Differential Revision: D16275329

fbshipit-source-id: eb2fbaecf4a232af415054b8decbe860ee2d7863
2019-07-16 20:52:31 -07:00
Mark Thomas
1d329cae5d rust: update to 2018 edition
Summary:
Update all rust crates that compile on Rust 2018 to use the 2018 edition.

The `commitcloudsubscriber` crate only compiles with Rust 2015, so make that
explicit in `Cargo.toml`.

Reviewed By: farnz

Differential Revision: D15601648

fbshipit-source-id: 7380e6e695fc3049913af91fcbde105dfe1be4bc
2019-06-03 07:22:36 -07:00
Jeremy Fitzhardinge
ac9b21844e Convert scm/hg/lib/cpython-failure to Rust 2018
Summary:
Rust 2018 updates to:
  //scm/hg/lib/cpython-failure:cpython-failure
  //scm/hg/lib/cpython-failure:cpython-failure-unittest

Reviewed By: quark-zju

Differential Revision: D15465466

fbshipit-source-id: 0a39b93f887047276b54f7cbc5f733ddfd3c829d
2019-05-22 23:57:49 -07:00
Mark Thomas
ca135cd33f cpython-failure: Integrate cpython PyResult with the failure crate
Summary:
Adds a new crate `cpython-result`, which provides a `ResultExt` trait, which
extends the failure `Result` type to allow coversion to `PyResult` by
converting the error to an appropriate Python Exception.

Reviewed By: quark-zju

Differential Revision: D12980782

fbshipit-source-id: 44a63d31f9ecf2f77efa3b37c68f9a99eaf6d6fa
2018-12-14 06:43:40 -08:00