( )⚙ D10558 rust: Use `&HgPath` instead of `&HgPathBuf` in may APIs

This is an archive of the discontinued Mercurial Phabricator instance.

rust: Use `&HgPath` instead of `&HgPathBuf` in may APIs
ClosedPublic

Authored by SimonSapin on May 3 2021, 6:26 AM.

Details

Summary

Getting the former (through Deref) is almost the only useful thing one can
do with the latter anyway. With this changes, API become more flexible for the
"provider" of these paths which may store something else that Deref’s to HgPath,
such as std::borrow::Cow<HgPath>. Using Cow can help reduce memory alloactions
and copying.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

SimonSapin created this revision.May 3 2021, 6:26 AM
Alphare accepted this revision.May 3 2021, 12:23 PM
This revision is now accepted and ready to land.May 3 2021, 12:23 PM
baymax updated this revision to Diff 27634.May 6 2021, 12:04 PM

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