Skip to content

"left behind trailing whitespace" when breaking after visibility of a field #5703

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

Open
jplatte opened this issue Mar 1, 2023 · 3 comments · May be fixed by #5708
Open

"left behind trailing whitespace" when breaking after visibility of a field #5703

jplatte opened this issue Mar 1, 2023 · 3 comments · May be fixed by #5708
Labels
e-trailing whitespace error[internal]: left behind trailing whitespace

Comments

@jplatte
Copy link

jplatte commented Mar 1, 2023

$ rustup run nightly cargo fmt -- --check
Diff in /home/jplatte/code/matrix-rust-sdk/crates/matrix-sdk/src/room/timeline/event_item/content.rs at line 292:
 /// of the sender of the reaction.
 #[derive(Clone, Debug, Default)]
 pub struct ReactionGroup(
-    pub(in crate::room::timeline)
+    pub(in crate::room::timeline) 
         IndexMap<(Option<OwnedTransactionId>, Option<OwnedEventId>), OwnedUserId>,
 );
 
error[internal]: left behind trailing whitespace
   --> /home/jplatte/code/matrix-rust-sdk/crates/matrix-sdk/src/room/timeline/event_item/content.rs:295:295:34
    |
295 |     pub(in crate::room::timeline) 
    |                                  ^
    |
@ytmimi
Copy link
Contributor

ytmimi commented Mar 1, 2023

@jplatte thanks for reaching out. Can you post the original code snippet instead of the diff. Additionally, what version of rustfmt are you using and are you using any non default configuration options?

@jplatte
Copy link
Author

jplatte commented Mar 1, 2023

This is from matrix-org/matrix-rust-sdk#1599 before pulling out the inner type of ReactionGroup in crates/matrix-sdk/src/room/timeline/event_item/content.rs into a type alias. The version of rustfmt that produces this error is 1.5.2-nightly (7281249 2023-02-27). Does that answer your questions?

@ytmimi
Copy link
Contributor

ytmimi commented Mar 1, 2023

Yeah, that helps! I just want to be clear that this was the original input snippet, and that there was no trailing whitespace to begin with.

#[derive(Clone, Debug, Default)]
pub struct ReactionGroup(
    pub(in crate::room::timeline)
        IndexMap<(Option<OwnedTransactionId>, Option<OwnedEventId>), OwnedUserId>,
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e-trailing whitespace error[internal]: left behind trailing whitespace
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants