This is an archive of the discontinued Mercurial Phabricator instance.

rust: Remove use of `py.eval()`
ClosedPublic

Authored by SimonSapin on Apr 8 2021, 3:39 PM.

Details

Summary

The previous Rust code allocated an intermediate Vec, converted that
to a Python list, then used eval to run Python code that converts that
list to a Python set.

rust-cpython exposes Rust bindings for Python sets, let’s use that instead
to construct a set directly.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.Apr 8 2021, 3:39 PM
baymax updated this revision to Diff 26736.Apr 8 2021, 8:16 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

marmoute accepted this revision.Apr 8 2021, 11:36 PM
marmoute added a subscriber: marmoute.

+1 (the set binding was not available at the time of writing, but they are not need to keep doing this now.)

pulkit accepted this revision.Apr 11 2021, 5:25 PM
This revision is now accepted and ready to land.Apr 11 2021, 5:25 PM
This revision was automatically updated to reflect the committed changes.