Skip to content

No space after semicolons & comma after struct fields is not "pretty" #290

@Boscop

Description

@Boscop

Consider this:

        [
            Some((
                asset: Misc(Buffer),
                sampler: (filter:mipmap,wrap:clamp,vflip:true), // should have spaces after semicolons & commas
            )),// [0]
            None,// [1]
            None,// [2]
            Some((
                asset: Misc(Stream),
                sampler: (filter:linear,wrap:clamp,vflip:true),
            )),
        ],

https://docs.rs/ron/0.6.2/ron/ser/struct.PrettyConfig.html#structfield.depth_limit

The types after this depth should still follow normal formatting guidelines like having spaces after semicolons & commas.

depth_limit: usize
Limit the pretty-ness up to the given depth.

What does this even mean? That everything after that level is not pretty-printed?
I use .with_depth_limit(4) but I don't want everything beyond that depth to not be pretty,
I just want to limit the depth for expanding types to multiple lines.

Actually what I'd really want is some max_width limit like in rustfmt to say that types should be written on one line unless they go over that limit. I thought that's what the depth limit is for, but apprently not.
Can you please add something like max_width? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature for the syntax or library.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions