-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add a chapter on custom formatting to the stagin area #129
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
Conversation
TIL: How to implement the |
@@ -0,0 +1,12 @@ | |||
The `std::fmt` module defines a number of traits each for one of the formatting | |||
argument types. |
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.
We need to introduce what "formatting argument types" are. I have opened #130 for this.
Thanks for the PR! I like the example. I was wondering if we should also implement another formatting trait (like Order-wise, this should go after the "traits" chapter |
Ok, I'm gonna fix the issues...
Yeah, I was thinking about that too, but the Cities example is not really suitable for that IMO. How about this: enum StoneAgeNumber {
One,
Two,
Many,
} and have it print "one", "two", "many" for |
@vojtechkral Sounds good to me! |
@japaric I'm in the process of updating this PR, there's a bit of a strange thing going on with the |
@japaric I'm still struggling to lay out this chapter so that it makes sense. Currently only one playpen editor per page is allowed, so I'd have to move the |
I'll re-review this later today, but I want to drop some notes now (or I might forget):
|
Using cities like in json :-)
I have no idea where this could go in the structure since traits are a bit too advanced a topic for the 2nd chapter...