-
Notifications
You must be signed in to change notification settings - Fork 136
Rustfmt everything #234
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
Rustfmt everything #234
Conversation
d857e77
to
4824cc8
Compare
r? @emilio |
Initially I hadn't noticed that Servo had custom settings for the formatter, so I added the config file and rerun rustfmt. Probably needs squashing. |
procedural-masquerade/lib.rs
Outdated
} | ||
} | ||
} | ||
($proc_macro_name: ident ! $paren: tt) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the extreme indentation of this macro definition as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks wrong. Maybe revert it and file a rustfmt issue?
Ident | | ||
Function | | ||
UrlOrBadUrl | | ||
DelimMinus | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems a little strange to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me modulo that macro. That seems like a weird rustfmt bug, since running rustfmt again with it ends up indenting it further.
In any case I think @SimonSapin should have the last word on this PR :)
procedural-masquerade/lib.rs
Outdated
} | ||
} | ||
} | ||
($proc_macro_name: ident ! $paren: tt) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks wrong. Maybe revert it and file a rustfmt issue?
src/from_bytes.rs
Outdated
Some(protocol_encoding) => return protocol_encoding | ||
} | ||
Some(protocol_encoding) => return protocol_encoding, | ||
}, | ||
} | ||
let prefix = b"@charset \""; | ||
if css.starts_with(prefix) { | ||
let rest = &css[prefix.len()..]; | ||
match rest.iter().position(|&b| b == b'"') { | ||
None => (), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could use if let
.
src/parser.rs
Outdated
Err(e) => unreachable!("Unexpected error encountered: {:?}", e), | ||
Ok(t) => Err(start.source_location().new_basic_unexpected_token_error(t.clone())), | ||
Ok(t) => Err(start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does look a bit weird as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's weird indeed. Putting them back on a single line fits under the line width limit too, so I'm not sure why this was formatted. Maybe another bug?
I'll file an issue for the macro bug (couldn't reply to that one for some reason).
r? @SimonSapin |
13053be
to
c8a12ad
Compare
☔ The latest upstream changes (presumably #238) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks! I’ve rebased and integrated this in #245. I removed the |
I was reading through the code and noticed that the formatting was different from what I understand to be the currently agreed upon convention. So I ran rustfmt on the entire repo. I hope that's welcome. Tests run as previously.
This change is