-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Improve code readability by moving fmt args directly into the string #114822
Conversation
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
Updated! |
@bors r+ |
@@ -933,7 +933,7 @@ impl Collector { | |||
if !item_path.is_empty() { | |||
item_path.push(' '); | |||
} | |||
format!("{} - {}(line {})", filename.prefer_local(), item_path, line) |
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.
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?
…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`
…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``
9f21e6d
to
16b34bf
Compare
Fixed raw string. @bors r=notriddle |
…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
There are some of occurrences where I also transformed
write!(f, "{}", x)
intof.write_str(x.as_str())
.r? @notriddle