You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the first example of concatenation there was an aside about String + &str taking ownership of
the first part (which might be an extra point against doing the multiple + given potential
precedence oddities) but there's nothing about how format! takes & (I went and looked it up in
the docs/code
basically it's because ownership is brought up during the previous example but not during this it
just felt a little strange.
This code will also set s to "tic-tac-toe". The format! macro works in the same way as println!,
but instead of printing the output to the screen, it returns a String with the contents. This
version is much easier to read than all of the +s.
The text was updated successfully, but these errors were encountered:
OK you mentioned that the book has previously discussed println!. I haven't actually read all the book recently, so reading through this chapter on it's own, this definitely jumped out at me as a question. It might be that readers of the actual book will not hit this since they'll have probably read the previous chapters...
In feedback from fbstj:
This feedback is about this paragraph in ch08-02-strings.md:
The text was updated successfully, but these errors were encountered: