( )⚙ D6485 rust-filepatterns: use bytes instead of String

This is an archive of the discontinued Mercurial Phabricator instance.

rust-filepatterns: use bytes instead of String
ClosedPublic

Authored by Alphare on Jun 6 2019, 11:24 AM.

Details

Summary

In my initial patch, I introduced an unnecessary hard constraint on UTF-8
filenames and patterns which I forgot to remove. Although the performance
penalty for using String might be negligible, we don't want to break
compatibility with non-UTF-8 encodings for no reason.
Moreover, this change allows for a cleaner Rust core API.

This patch introduces a new utils module that is used with this fix.

Finally, PatternError was not put inside the Python module generated by
Rust, which would have raised a NameError.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped