mathstuf / rust-keyutils

Rust interface to the Linux keyring
BSD 3-Clause "New" or "Revised" License
17 stars 9 forks source link

Cleanup payload formatting to avoid allocation #23

Closed josephlr closed 5 years ago

josephlr commented 5 years ago

Depends on #27 for test fixes

Much of the payload formatting code makes liberal use of format!(). Unfortunately, this causes many more internal allocations than needed, it also makes the code much more complex. The idiomatic way to fix this in Rust is to use the std::fmt traits.

This PR implements:

Allowing us to simply the code and remove:

josephlr commented 5 years ago

Could you please rebase now that #22 has been merged?

Done, the tests seem to be failing now, almost certainly due to #25 and #21

mathstuf commented 5 years ago

Thanks! Could you please rebase now that #27 is merged.

josephlr commented 5 years ago

Thanks! Could you please rebase now that #27 is merged.

Done, clippy is failing (fixed by #26) and nightly is failing (fixed by #28)