-
Notifications
You must be signed in to change notification settings - Fork 901
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
Empty lines wrongly removed #4930
Comments
Please provide your version of rustfmt, and the original, pre-formatted input along with, and separate from, the formatted result |
Please see #4928 regarding the version, and which also provides before and after copies of the code snippet applicable here. |
Updated with specific version string. |
Should this be closed @jnqnfe? It looks like the issue you linked has been closed. |
seems related to #3716 |
rustfmt also removes blank lines at the end of the struct definition, between the last field and a comment, in the same way as this issue already describes for the beginning of the struct definition. That is, struct Foo {
// Introductory comment.
/// Blah blah blah.
foo: String,
// Final comment.
} is formatted as struct Foo {
// Introductory comment.
/// Blah blah blah.
foo: String,
// Final comment.
} and I think both blank lines should be preserved. |
The empty line after the initial comment within the struct definition here is there deliberately to separate it from the comments associated with the first attribute. rustfmt should not remove it, just as it preserves the choice I made to have empty lines between attributes for this struct.
#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct TimingInfo { /* NOTE: This struct must be directly usable by the C API, thus same attributes/layout/etc */ - /// The system clock time when this timing info structure was current. pub timestamp: Timeval, /// Non-zero if the local and the remote machine have synchronized clocks. If synchronized /// clocks are detected `transport_usec` becomes much more reliable. However, the code that /// detects synchronized clocks is very limited and unreliable itself. pub synchronized_clocks: i32, /// Time in usecs a sample takes to be played on the sink. For playback streams and record /// streams connected to a monitor source. pub sink_usec: MicroSeconds,
config:
Version string: rustfmt 1.4.37-stable (a178d03 2021-07-26)
Project: https://github.com/jnqnfe/pulse-binding-rust
Specific file: https://github.com/jnqnfe/pulse-binding-rust/blob/master/pulse-binding/src/def.rs
Ran against the master branch after adding the quoted config.
The text was updated successfully, but these errors were encountered: