Both parse_dirstate and pack_dirstate can operate directly on the data
they're passed, which prevents the creation of intermediate data structures,
simplifies the function signatures and reduces boilerplate. They are exposed
directly to the Python for now, but a later patch will make use of them inside
hg-core.
Details
Details
Diff Detail
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
rust/hg-core/src/dirstate/mod.rs | ||
---|---|---|
16 ↗ | (On Diff #15897) | If these are always 20 bytes long you are best to use [u8; 20]. That way there will be no indirection. And since Vec is 3 words it will have a bigger immediate size on 64bit platforms. |
rust/hg-core/src/dirstate/parsers.rs | ||
85–86 | The "proper" solution is SystemTime however I will admit that it is a bit more awkward to use. However if you are going to use Duration please document that it is the Duration since the Unix Epoch. | |
91 | Would it be best to panic on overflow? now.as_secs().try_into::<i32>().expect("time overflow"). |
The "proper" solution is SystemTime however I will admit that it is a bit more awkward to use. However if you are going to use Duration please document that it is the Duration since the Unix Epoch.