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

run rustfmt on btree folder #38530

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 32 additions & 28 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<K, ()>
match search::search_tree(self.root.as_mut(), key) {
Found(handle) => {
Some(OccupiedEntry {
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.remove_kv()
.0)
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.remove_kv()
.0)
}
GoDown(_) => None,
}
Expand All @@ -251,12 +251,12 @@ impl<K, Q: ?Sized> super::Recover<Q> for BTreeMap<K, ()>
Found(handle) => Some(mem::replace(handle.into_kv_mut().0, key)),
GoDown(handle) => {
VacantEntry {
key: key,
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.insert(());
key: key,
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.insert(());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this normal that these are pushed so far to the right

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @nrc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could probably take this PR if this indentation is fixed manually.

None
}
}
Expand Down Expand Up @@ -340,12 +340,16 @@ pub enum Entry<'a, K: 'a, V: 'a> {
impl<'a, K: 'a + Debug + Ord, V: 'a + Debug> Debug for Entry<'a, K, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Vacant(ref v) => f.debug_tuple("Entry")
.field(v)
.finish(),
Occupied(ref o) => f.debug_tuple("Entry")
.field(o)
.finish(),
Vacant(ref v) => {
f.debug_tuple("Entry")
.field(v)
.finish()
}
Occupied(ref o) => {
f.debug_tuple("Entry")
.field(o)
.finish()
}
}
}
}
Expand All @@ -367,8 +371,8 @@ pub struct VacantEntry<'a, K: 'a, V: 'a> {
impl<'a, K: 'a + Debug + Ord, V: 'a> Debug for VacantEntry<'a, K, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("VacantEntry")
.field(self.key())
.finish()
.field(self.key())
.finish()
}
}

Expand All @@ -389,9 +393,9 @@ pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
impl<'a, K: 'a + Debug + Ord, V: 'a + Debug> Debug for OccupiedEntry<'a, K, V> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("OccupiedEntry")
.field("key", self.key())
.field("value", self.get())
.finish()
.field("key", self.key())
.field("value", self.get())
.finish()
}
}

Expand Down Expand Up @@ -591,11 +595,11 @@ impl<K: Ord, V> BTreeMap<K, V> {
match search::search_tree(self.root.as_mut(), key) {
Found(handle) => {
Some(OccupiedEntry {
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.remove())
handle: handle,
length: &mut self.length,
_marker: PhantomData,
}
.remove())
}
GoDown(_) => None,
}
Expand Down
Loading