-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing
Format.pp_print_bytes
function.
This is implemented through a copy using `Bytes.to_string`. While this seems sub-optimal, avoiding a copy (either through `Bytes.unsafe_to_string` or by adding a new formatting action) would "capture" the bytes but would not immediately print it (formatting might wait before making indentation decision). During this period the bytes might be mutated again leading to a confusing behavior. We avoid this problem by making a copy. Users who require zero-copy output can reimplement it easily (with `Bytes.unsafe_to_string`) and ensure proper owernship manually.
- Loading branch information
Showing
4 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters