-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
remove termtree dependency #11416
remove termtree dependency #11416
Conversation
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.
Thank you @Kev1n8 -- this is a very nice contribution 🙏
I started the CI -- and once that passes I think this PR could be merged.
I had a few questions / suggestions but nothing major.
Thanks again!
) { | ||
if let Some(Some(hi)) = self.heap.get(idx) { | ||
let connector = if idx != 0 { | ||
if is_tail { |
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.
Nice!
@@ -361,9 +385,9 @@ impl<VAL: ValueType> HeapItem<VAL> { | |||
impl<VAL: ValueType> Debug for HeapItem<VAL> { | |||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | |||
f.write_str("bucket=")?; | |||
self.map_idx.fmt(f)?; | |||
Debug::fmt(&self.map_idx, f)?; |
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 this change needed?
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.
I think so. If it's not changed, the compiler will fail and report fmt
being ambiguous
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.
Makes sense -- thank you
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.
Thanks again @Kev1n8
FYI @avantgardnerio
Thanks again |
* remove termtree dependency * impl Display for TopKHeap, replace uses of tree_print in tests * use to_string instead of format!
* remove termtree dependency * impl Display for TopKHeap, replace uses of tree_print in tests * use to_string instead of format!
* remove termtree dependency * impl Display for TopKHeap, replace uses of tree_print in tests * use to_string instead of format!
Which issue does this PR close?
Closes #11389
Rationale for this change
What changes are included in this PR?
Remove uses of termtree::tree in heap.rs. Directly generate the string instead.
Are these changes tested?
Are there any user-facing changes?