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

Pretty print Slices #6680

Closed
wants to merge 2 commits into from
Closed

Pretty print Slices #6680

wants to merge 2 commits into from

Commits on Oct 14, 2020

  1. Pretty print Slices

    This code is adapted from @pixelherodev paste from IRC
    
    I have added a new fmt option to handle printing slice values ``{v}`` or ``{V}``
    
    While i think it can be made the default, i want your opinion about it
    
    ```zig
        var slicea = [0]u32{};
        var sliceb = [3]u32{ 1, 2, 3 };
    
        std.log.info("Content: {v}", .{slicea});
        std.log.info("Content: {v}", .{sliceb});
    ```
    
    will print:
    
    ```
    info: Content: []
    info: Content: [1, 2, 3]
    ```
    
    Question:
    
    Should we drop ``{v}`` and make it the default behavior?
    ryuukk committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    d1e7d36 View commit details
    Browse the repository at this point in the history
  2. Formatting fix

    ryuukk committed Oct 14, 2020
    Configuration menu
    Copy the full SHA
    761dd96 View commit details
    Browse the repository at this point in the history