We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0306ffb commit 47a0f69Copy full SHA for 47a0f69
src/tools/compiletest/src/header.rs
@@ -170,14 +170,14 @@ impl EarlyProps {
170
.take(3) // 3 or more = invalid, so take at most 3.
171
.collect::<Vec<Option<u32>>>();
172
173
- match range_components.len() {
174
- 1 => {
175
- let v = range_components[0].unwrap();
+ match *range_components {
+ [v] => {
+ let v = v.unwrap();
176
(v, v)
177
}
178
- 2 => {
179
- let v_min = range_components[0].unwrap();
180
- let v_max = range_components[1].expect(ERROR_MESSAGE);
+ [min, max] => {
+ let v_min = min.unwrap();
+ let v_max = max.expect(ERROR_MESSAGE);
181
(v_min, v_max)
182
183
_ => panic!(ERROR_MESSAGE),
0 commit comments