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

Use brace_style for struct instantiation #4938

Closed
Iron-E opened this issue Aug 5, 2021 · 3 comments
Closed

Use brace_style for struct instantiation #4938

Iron-E opened this issue Aug 5, 2021 · 3 comments

Comments

@Iron-E
Copy link

Iron-E commented Aug 5, 2021

New struct instances don't adhere to brace_style. For example, when brace_style = "AlwaysNextLine", a new struct instance will look like this:

let value = MyStruct {
    something: 1
}

When it should look like this:

let value = MyStruct
{
    something: 1
}

Originally posted by @Sibz in #3376 (comment)

@Iron-E
Copy link
Author

Iron-E commented Aug 6, 2021

This also applies when using macro variables:

$foo {
  bar: 1
}

Edit: looks like the above is a also related to:

let foo = {
  3
};

And:

foo.bar({
  3
});

Blocks without a context (like unsafe) don't get put on the next line

@calebcartwright
Copy link
Member

Thanks for opening all these, but I'm going to close all of them, at least for the time being, pending conclusion of the strategy discussion in #3376

@Iron-E
Copy link
Author

Iron-E commented Sep 6, 2021

Alright. Perhaps given the introduction of a new option fitting this scope they can be reopened 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants