Skip to content

Commit cfac991

Browse files
committed
Use inline variables when formatting
Fixes CI failure.
1 parent 1daf11d commit cfac991

File tree

6 files changed

+16
-23
lines changed

6 files changed

+16
-23
lines changed

rrule/src/core/datetime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ pub(crate) fn datetime_to_ical_format(dt: &chrono::DateTime<Tz>) -> String {
4747
}
4848

4949
let dt = dt.format("%Y%m%dT%H%M%S");
50-
format!("{}:{}{}", tz_prefix, dt, tz_postfix)
50+
format!("{tz_prefix}:{dt}{tz_postfix}")
5151
}

rrule/src/core/rrule.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl Display for Frequency {
5252
Self::Minutely => "MINUTELY",
5353
Self::Secondly => "SECONDLY",
5454
};
55-
write!(f, "{}", name)
55+
write!(f, "{name}")
5656
}
5757
}
5858

@@ -188,13 +188,13 @@ impl Display for NWeekday {
188188
Self::Nth(number, wd) => {
189189
let mut wd_str = weekday_to_str(*wd);
190190
if *number != 1 {
191-
wd_str = format!("{}{}", number, wd_str);
191+
wd_str = format!("{number}{wd_str}");
192192
};
193193
wd_str
194194
}
195195
};
196196

197-
write!(f, "{}", weekday)
197+
write!(f, "{weekday}")
198198
}
199199
}
200200

@@ -647,7 +647,7 @@ impl<S> Display for RRule<S> {
647647
}
648648

649649
if let Some(count) = &self.count {
650-
res.push(format!("COUNT={}", count));
650+
res.push(format!("COUNT={count}"));
651651
}
652652

653653
// One interval is the default, no need to expose it.

rrule/src/iter/operation_errors.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,21 @@ use crate::RRuleError;
33
pub(crate) fn checked_mul_u32(v1: u32, v2: u32, hint: Option<&str>) -> Result<u32, RRuleError> {
44
v1.checked_mul(v2).ok_or_else(|| match hint {
55
Some(hint) => RRuleError::new_iter_err(format!(
6-
"Could not multiply number, would overflow (`{} * {}`), {}.",
7-
v1, v2, hint
6+
"Could not multiply number, would overflow (`{v1} * {v2}`), {hint}."
87
)),
98
None => RRuleError::new_iter_err(format!(
10-
"Could not multiply number, would overflow (`{} * {}`).",
11-
v1, v2,
9+
"Could not multiply number, would overflow (`{v1} * {v2}`).",
1210
)),
1311
})
1412
}
1513

1614
pub(crate) fn checked_add_u32(v1: u32, v2: u32, hint: Option<&str>) -> Result<u32, RRuleError> {
1715
v1.checked_add(v2).ok_or_else(|| match hint {
1816
Some(hint) => RRuleError::new_iter_err(format!(
19-
"Could not add numbers, would overflow (`{} + {}`), {}.",
20-
v1, v2, hint
17+
"Could not add numbers, would overflow (`{v1} + {v2}`), {hint}."
2118
)),
2219
None => RRuleError::new_iter_err(format!(
23-
"Could not add numbers, would overflow (`{} + {}`).",
24-
v1, v2,
20+
"Could not add numbers, would overflow (`{v1} + {v2}`).",
2521
)),
2622
})
2723
}

rrule/src/iter/rrule_iter.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ impl RRuleIter {
107107
self.finished = true;
108108
self.was_limited = true;
109109
log::warn!(
110-
"Reached max loop counter (`{}`). \
111-
See 'validator limits' in docs for more info.",
112-
MAX_ITER_LOOP
110+
"Reached max loop counter (`{MAX_ITER_LOOP}`). \
111+
See 'validator limits' in docs for more info."
113112
);
114113
return true;
115114
}

rrule/src/iter/rruleset_iter.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ impl RRuleSetIter {
4343
loop_counter += 1;
4444
if loop_counter >= MAX_ITER_LOOP {
4545
log::warn!(
46-
"Reached max loop counter (`{}`). \
47-
See 'validator limits' in docs for more info.",
48-
MAX_ITER_LOOP
46+
"Reached max loop counter (`{MAX_ITER_LOOP}`). \
47+
See 'validator limits' in docs for more info."
4948
);
5049
return (None, true);
5150
}
@@ -73,9 +72,8 @@ impl RRuleSetIter {
7372
loop_counter += 1;
7473
if loop_counter >= MAX_ITER_LOOP {
7574
log::warn!(
76-
"Reached max loop counter (`{}`). \
77-
See 'validator limits' in docs for more info.",
78-
MAX_ITER_LOOP
75+
"Reached max loop counter (`{MAX_ITER_LOOP}`). \
76+
See 'validator limits' in docs for more info."
7977
);
8078
return (None, true);
8179
}

rrule/src/parser/content_line/content_line_parts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'a> ContentLineCaptures<'a> {
2323
}),
2424
property_name => {
2525
let mut parameters = None;
26-
if line.starts_with(&format!("{};", property_name)) {
26+
if line.starts_with(&format!("{property_name};")) {
2727
let only_colon_idx = line.find(':');
2828
if let Some(only_colon_idx) = only_colon_idx {
2929
parameters =

0 commit comments

Comments
 (0)