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

writeln! documentation should tell what kind of newline is used #34697

Closed
glandium opened this issue Jul 7, 2016 · 3 comments
Closed

writeln! documentation should tell what kind of newline is used #34697

glandium opened this issue Jul 7, 2016 · 3 comments

Comments

@glandium
Copy link
Contributor

glandium commented Jul 7, 2016

As I was using writeln! to fill an in-memory buffer for data that explicitly wants a specific type of newlines (LF, fortunately), and I was wondering whether writeln! would always use LF, or would use the type of newline relevant to the platform (essentially, LF on Unix, CR/LF on Windows), and couldn't find the answer in https://doc.rust-lang.org/std/macro.writeln!.html.

(I got my answer on IRC, it's always LF)

There may be other places where such information is relevant (println! comes to mind).

Cc: @steveklabnik

@GuillaumeGomez
Copy link
Member

@glandium: Sure, want to add it? :)

@glandium
Copy link
Contributor Author

glandium commented Jul 8, 2016

I would, if I knew whether there are other places that would benefit from this information as well.

@GuillaumeGomez
Copy link
Member

Except for writeln! and println!, I don't see any places... You can already add it to these docs and if another function/macro needs it, then we'll add it.

glandium added a commit to glandium/rust that referenced this issue Jul 12, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 15, 2016
doc: Mention that writeln! and println! always use LF

Fixes rust-lang#34697

I'm not really satisfied with the wording, but I didn't have a better idea. Suggestions welcome.
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

No branches or pull requests

3 participants