-
Notifications
You must be signed in to change notification settings - Fork 13k
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
run rustfmt on libcollections/btree folder #34087
run rustfmt on libcollections/btree folder #34087
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
unsafe { | ||
BoxedNode { ptr: Unique::new(Box::into_raw(node)) } | ||
} | ||
unsafe { BoxedNode { ptr: Unique::new(Box::into_raw(node)) } } |
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.
The previous version was much better here. Ditto below.
cc @nrc |
unsafe impl<K: Sync, V: Sync> Sync for Root<K, V> { } | ||
unsafe impl<K: Send, V: Send> Send for Root<K, V> { } | ||
unsafe impl<K: Sync, V: Sync> Sync for Root<K, V> {} | ||
unsafe impl<K: Send, V: Send> Send for Root<K, V> {} |
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 seriously surprises me - every empty brace pair I've seen in the Rust codebase has had a space in the middle.
There are a few things shown in this PR that I just don't really understand:
I don't want this PR to devolve into bickering about meaningless style, and there definitely are many clear improvements here, but those stuck out to me as odd and, more importantly, divergent from what the rest of the Rust codebase has accepted. As a side note, since most of what is being edited here is my code, this PR paints a really fascinating, clear picture of where my personal style diverges from |
let mut new_root = Root { | ||
node: edge, | ||
height: internal.height - 1, | ||
}; |
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 looks fine (in fact, I like the expanded look a bit better), but it surprises me given that rustfmt
kept some longer and more cumbersome struct
initializers as a single line farther up.
Thank you for doing this - when I wrote this code, I remember explicitly making completely arbitrary style choices multiple times, since nothing I thought of looked particularly good. I will admit that this module is somewhat of a worst case for |
Also, it definitely seems like a bug that rustfmt generated overlong lines. |
There's a few places here which could be improved, but I don't think there are any where I would get Rustfmt to skip. In general, I'm happy to eat a few spots of sub-optimal formatting in order to get automated formatting everywhere. We could always add rustfmt_skip if there are places that @gereeter feels are obnoxiously bad. Overlong lines are bugs we should fix (before landing). |
I filed rust-lang/rustfmt#1048 and rust-lang/rustfmt#1049 for the overlong lines |
☔ The latest upstream changes (presumably #34153) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm still not sure what to do here. The code does look quite bad in places, and to bring this patch up to date rustfmt will need to be rerun completely. |
let's close for now, we can open a new PR once those bugs get fixed in Rustfmt |
No description provided.