Skip to content
This repository was archived by the owner on Aug 12, 2021. It is now read-only.

Commit e65d552

Browse files
committed
migrate codebase to ..= inclusive range patterns
These were stabilized in March 2018's #47813, and are the Preferred Way to Do It going forward (q.v. #51043).
1 parent 1e46669 commit e65d552

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

terminfo/parm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) -> Result<Vec<
215215
return Err("stack is empty".to_string());
216216
}
217217
}
218-
':' | '#' | ' ' | '.' | '0'...'9' => {
218+
':' | '#' | ' ' | '.' | '0'..='9' => {
219219
let mut flags = Flags::new();
220220
let mut fstate = FormatStateFlags;
221221
match cur {
222222
':' => (),
223223
'#' => flags.alternate = true,
224224
' ' => flags.space = true,
225225
'.' => fstate = FormatStatePrecision,
226-
'0'...'9' => {
226+
'0'..='9' => {
227227
flags.width = cur as usize - '0' as usize;
228228
fstate = FormatStateWidth;
229229
}
@@ -337,14 +337,14 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) -> Result<Vec<
337337
(FormatStateFlags, ' ') => {
338338
flags.space = true;
339339
}
340-
(FormatStateFlags, '0'...'9') => {
340+
(FormatStateFlags, '0'..='9') => {
341341
flags.width = cur as usize - '0' as usize;
342342
*fstate = FormatStateWidth;
343343
}
344344
(FormatStateFlags, '.') => {
345345
*fstate = FormatStatePrecision;
346346
}
347-
(FormatStateWidth, '0'...'9') => {
347+
(FormatStateWidth, '0'..='9') => {
348348
let old = flags.width;
349349
flags.width = flags.width * 10 + (cur as usize - '0' as usize);
350350
if flags.width < old {
@@ -354,7 +354,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables) -> Result<Vec<
354354
(FormatStateWidth, '.') => {
355355
*fstate = FormatStatePrecision;
356356
}
357-
(FormatStatePrecision, '0'...'9') => {
357+
(FormatStatePrecision, '0'..='9') => {
358358
let old = flags.precision;
359359
flags.precision = flags.precision * 10 + (cur as usize - '0' as usize);
360360
if flags.precision < old {

0 commit comments

Comments
 (0)