Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing Format.pp_print_bytes function. #10430

Merged
merged 1 commit into from
May 28, 2021
Merged

Commits on May 28, 2021

  1. 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.
    Drup committed May 28, 2021
    Configuration menu
    Copy the full SHA
    ef6b4b0 View commit details
    Browse the repository at this point in the history