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

Improve code readability by moving fmt args directly into the string #114822

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

GuillaumeGomez
Copy link
Member

There are some of occurrences where I also transformed write!(f, "{}", x) into f.write_str(x.as_str()).

r? @notriddle

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 14, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2023

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@GuillaumeGomez
Copy link
Member Author

Updated!

@notriddle
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 15, 2023

📌 Commit 9f21e6d has been approved by notriddle

It is now in the queue for this repository.

@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 Aug 15, 2023
@@ -933,7 +933,7 @@ impl Collector {
if !item_path.is_empty() {
item_path.push(' ');
}
format!("{} - {}(line {})", filename.prefer_local(), item_path, line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some discussion that mixing few types of format parameters is harder to read: it need to track different places over code, instead sticking to one method. Or not?

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 15, 2023
…provement, r=notriddle

Improve code readability by moving fmt args directly into the string

There are some of occurrences where I also transformed `write!(f, "{}", x)` into `f.write_str(x.as_str())`.

r? `@notriddle`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 16, 2023
…provement, r=notriddle

Improve code readability by moving fmt args directly into the string

There are some of occurrences where I also transformed `write!(f, "{}", x)` into `f.write_str(x.as_str())`.

r? ``@notriddle``
@GuillaumeGomez
Copy link
Member Author

Fixed raw string.

@bors r=notriddle

@bors
Copy link
Contributor

bors commented Aug 16, 2023

📌 Commit 16b34bf has been approved by notriddle

It is now in the queue for this repository.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 16, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#113115 (we are migrating to askama)
 - rust-lang#114784 (Improve `invalid_reference_casting` lint)
 - rust-lang#114822 (Improve code readability by moving fmt args directly into the string)
 - rust-lang#114878 (rustc book: make more pleasant to search)
 - rust-lang#114899 (Add missing Clone/Debug impls to SMIR Trait related tys)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6533929 into rust-lang:master Aug 16, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 16, 2023
@GuillaumeGomez GuillaumeGomez deleted the code-readability-improvement branch August 16, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants