1
Fork 0

Avoid naming variables str

This renames variables named `str` to other names, to make sure `str`
always refers to a type.

It's confusing to read code where `str` (or another standard type name)
is used as an identifier. It also produces misleading syntax
highlighting.
This commit is contained in:
Josh Triplett 2025-01-07 14:12:07 +02:00
parent fb546ee09b
commit bb6bbfa13f
10 changed files with 34 additions and 34 deletions

View file

@ -544,12 +544,12 @@ fn pretty_print_region_elements(elements: impl IntoIterator<Item = RegionElement
return result;
fn push_location_range(str: &mut String, location1: Location, location2: Location) {
fn push_location_range(s: &mut String, location1: Location, location2: Location) {
if location1 == location2 {
str.push_str(&format!("{location1:?}"));
s.push_str(&format!("{location1:?}"));
} else {
assert_eq!(location1.block, location2.block);
str.push_str(&format!(
s.push_str(&format!(
"{:?}[{}..={}]",
location1.block, location1.statement_index, location2.statement_index
));