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

Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar #84852

Merged
merged 1 commit into from
May 3, 2021

Conversation

mautamu
Copy link
Contributor

@mautamu mautamu commented May 3, 2021

Howdy,

This PR does the following:

  1. Updates the grammar of a comment in librustdoc.
  2. Replaces a few write!(..\n) macros with writeln!(..\n) for clarity. (Please let me know if there is a reason why this might be wrong!)

Best,
Mautamu

@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 @GuillaumeGomez (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. Due to 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 the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 3, 2021
@GuillaumeGomez
Copy link
Member

Isn't writeln! using "\r\n" on windows? If so, it'd be very problematic.

@mautamu
Copy link
Contributor Author

mautamu commented May 3, 2021

Isn't writeln! using "\r\n" on windows? If so, it'd be very problematic.

https://doc.rust-lang.org/std/macro.writeln.html
"On all platforms, the newline is the LINE FEED character (\n/U+000A) alone (no additional CARRIAGE RETURN (\r/U+000D)."

#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(format_args_nl)]
macro_rules! writeln {
    ($dst:expr $(,)?) => (
        $crate::write!($dst, "\n")
    );
    ($dst:expr, $($arg:tt)*) => (
        $dst.write_fmt($crate::format_args_nl!($($arg)*))
    );
}

I think it's just calling \n? (I apologize if I'm referring to the wrong macro or missing something, not particularly familiar with macros).

@GuillaumeGomez
Copy link
Member

No that seems correct, thanks for the confirmation! (I was only reading the source code and not the docs... Well, now I know sometimes reading docs is better haha).

@GuillaumeGomez
Copy link
Member

r=me once CI pass

@mautamu
Copy link
Contributor Author

mautamu commented May 3, 2021

Ah, thanks for double checking; I hadn't thought to look there! : )

@GuillaumeGomez
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented May 3, 2021

📌 Commit 8db7973 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2021
…laumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#84835 (Add link to Issue rust-lang#34202 in udp docs)
 - rust-lang#84852 (Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar)
 - rust-lang#84854 (use double quotes and full path for E0761)
 - rust-lang#84856 (Correct stability of ErrorKind::OutOfMemory)
 - rust-lang#84858 (Fix stability attributes of byte-to-string specialization)
 - rust-lang#84860 (Link to MCP from target tier policy)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ed1646a into rust-lang:master May 3, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants