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

Expand println section #495

Closed
6 of 7 tasks
mdinger opened this issue Mar 8, 2015 · 8 comments
Closed
6 of 7 tasks

Expand println section #495

mdinger opened this issue Mar 8, 2015 · 8 comments

Comments

@mdinger
Copy link
Contributor

mdinger commented Mar 8, 2015

The println! section should be expanded to include:

  • print!
  • println!
  • format!
  • {} vs {:?}
  • {:b} and other formatting parameters
  • Why doesn't {} work for vectors and generic containers?
  • Explain {:#?} RFC 640

@crumblingstatue Note anything else that should be added. I'll add it to the list.

@crumblingstatue
Copy link

I agree that more chapters could be added in the "Formatted print" section.
However, the first introduction to println! should use fmt::Display for formatting, as that is the natural way of writing formatted output. fmt::Debug shouldn't be taught as the "default" way of writing formatted output, but it should certainly be mentioned, as it is a useful tool for debugging.

@mdinger mdinger mentioned this issue Mar 8, 2015
@mdinger
Copy link
Contributor Author

mdinger commented Mar 16, 2015

reddit thread highlighting confusion usage of {:?} created.

@mdinger
Copy link
Contributor Author

mdinger commented Mar 16, 2015

Added {:#?} to header. RFC 640 has landed: http://is.gd/hdfaHi

@mdinger
Copy link
Contributor Author

mdinger commented Mar 22, 2015

#196 is very similar to this issue but has different suggestions

@coffeejunk
Copy link

It might be helpful to add a small paragraph about print! needing a flush() to immediately display text on stdout

(ref rust-lang/rust#23818)

@steveklabnik
Copy link
Member

Looks like there's only one checkbox left; I'd be more than happy to mentor anyone who wants to work on this!

@maccoda
Copy link
Contributor

maccoda commented Oct 13, 2017

@steveklabnik Looks like this one is also complete thanks to @vishalsodani 😄

@steveklabnik
Copy link
Member

🎊

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

No branches or pull requests

5 participants