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

implement fmt traits for collections #20932

Closed
wants to merge 5 commits into from

Conversation

skullzzz
Copy link

Closes #19670

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

if i != 0 { try!(write!(f, ", ")); }
try!(write!(f, "{:?}: {:?}", *k, *v));
}
macro_rules! fmt_btree_map {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps these macros could be refactored to generic functions? I think basically all of them work off some form of iterator, so perhaps that could be a private implementation detail of this library for now?

@alexcrichton
Copy link
Member

cc @gankro, curious what you think of this.

@Gankra
Copy link
Contributor

Gankra commented Jan 13, 2015

We already leverage a fair amount of iterator-utility magic in the collections, I would think that a lot of these can be written in terms of some basic iterator utility that is added to appropriate iterators via some trait. You would need to have seperate utils for printing like a map vs a sequence, though.

@Gankra
Copy link
Contributor

Gankra commented Jan 13, 2015

Also have we actually settled the conventions for the output these should produce? CC @aturon

@aturon
Copy link
Member

aturon commented Jan 13, 2015

@gankro still settling: rust-lang/rfcs#565

- added some tests to run-pass/ifmt as well
@steveklabnik
Copy link
Member

This does not merge cleanly any more.

@aturon
Copy link
Member

aturon commented Jan 31, 2015

(Conventions are now settled, rust-lang/rfcs#565)

@skullzzz
Copy link
Author

skullzzz commented Feb 1, 2015

I'll have an updated PR soon (2-3 days)

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

@skullzzz
Copy link
Author

@alexcrichton
Sorry about the delay. Is there supposed to be a reopen button or something?

@Gankra
Copy link
Contributor

Gankra commented Mar 25, 2015

@skullzzz Just submit a new PR :)

@reem
Copy link
Contributor

reem commented Mar 25, 2015

@skullzzz just for github knowledge: you can only re-open an issue or pull request if you closed it or have push access to the repository.

@alexcrichton
Copy link
Member

@skullzzz ah yes sorry, I always forget that github only shows the reopen button to committers I think.. A new PR would do well though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatters for collections
7 participants