1 error: clamp-like pattern without using clamp function
2 --> $DIR/manual_clamp.rs:76:5
10 | |_____^ help: replace with clamp: `x9 = x9.clamp(min, max);`
12 = note: clamp will panic if max < min
13 = note: `-D clippy::manual-clamp` implied by `-D warnings`
15 error: clamp-like pattern without using clamp function
16 --> $DIR/manual_clamp.rs:91:5
24 | |_____^ help: replace with clamp: `x11 = x11.clamp(min, max);`
26 = note: clamp will panic if max < min
28 error: clamp-like pattern without using clamp function
29 --> $DIR/manual_clamp.rs:99:5
37 | |_____^ help: replace with clamp: `x12 = x12.clamp(min, max);`
39 = note: clamp will panic if max < min
41 error: clamp-like pattern without using clamp function
42 --> $DIR/manual_clamp.rs:107:5
50 | |_____^ help: replace with clamp: `x13 = x13.clamp(min, max);`
52 = note: clamp will panic if max < min
54 error: clamp-like pattern without using clamp function
55 --> $DIR/manual_clamp.rs:161:5
63 | |_____^ help: replace with clamp: `x33 = x33.clamp(min, max);`
65 = note: clamp will panic if max < min
67 error: clamp-like pattern without using clamp function
68 --> $DIR/manual_clamp.rs:21:14
70 LL | let x0 = if max < input {
73 LL | | } else if min > input {
78 | |_____^ help: replace with clamp: `input.clamp(min, max)`
80 = note: clamp will panic if max < min
82 error: clamp-like pattern without using clamp function
83 --> $DIR/manual_clamp.rs:29:14
85 LL | let x1 = if input > max {
88 LL | | } else if input < min {
93 | |_____^ help: replace with clamp: `input.clamp(min, max)`
95 = note: clamp will panic if max < min
97 error: clamp-like pattern without using clamp function
98 --> $DIR/manual_clamp.rs:37:14
100 LL | let x2 = if input < min {
103 LL | | } else if input > max {
108 | |_____^ help: replace with clamp: `input.clamp(min, max)`
110 = note: clamp will panic if max < min
112 error: clamp-like pattern without using clamp function
113 --> $DIR/manual_clamp.rs:45:14
115 LL | let x3 = if min > input {
118 LL | | } else if max < input {
123 | |_____^ help: replace with clamp: `input.clamp(min, max)`
125 = note: clamp will panic if max < min
127 error: clamp-like pattern without using clamp function
128 --> $DIR/manual_clamp.rs:53:14
130 LL | let x4 = input.max(min).min(max);
131 | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)`
133 = note: clamp will panic if max < min
135 error: clamp-like pattern without using clamp function
136 --> $DIR/manual_clamp.rs:55:14
138 LL | let x5 = input.min(max).max(min);
139 | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)`
141 = note: clamp will panic if max < min
143 error: clamp-like pattern without using clamp function
144 --> $DIR/manual_clamp.rs:57:14
146 LL | let x6 = match input {
148 LL | | x if x > max => max,
149 LL | | x if x < min => min,
152 | |_____^ help: replace with clamp: `input.clamp(min, max)`
154 = note: clamp will panic if max < min
156 error: clamp-like pattern without using clamp function
157 --> $DIR/manual_clamp.rs:63:14
159 LL | let x7 = match input {
161 LL | | x if x < min => min,
162 LL | | x if x > max => max,
165 | |_____^ help: replace with clamp: `input.clamp(min, max)`
167 = note: clamp will panic if max < min
169 error: clamp-like pattern without using clamp function
170 --> $DIR/manual_clamp.rs:69:14
172 LL | let x8 = match input {
174 LL | | x if max < x => max,
175 LL | | x if min > x => min,
178 | |_____^ help: replace with clamp: `input.clamp(min, max)`
180 = note: clamp will panic if max < min
182 error: clamp-like pattern without using clamp function
183 --> $DIR/manual_clamp.rs:83:15
185 LL | let x10 = match input {
187 LL | | x if min > x => min,
188 LL | | x if max < x => max,
191 | |_____^ help: replace with clamp: `input.clamp(min, max)`
193 = note: clamp will panic if max < min
195 error: clamp-like pattern without using clamp function
196 --> $DIR/manual_clamp.rs:114:15
198 LL | let x14 = if input > CONST_MAX {
201 LL | | } else if input < CONST_MIN {
206 | |_____^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
208 = note: clamp will panic if max < min
210 error: clamp-like pattern without using clamp function
211 --> $DIR/manual_clamp.rs:123:19
213 LL | let x15 = if input > max {
214 | ___________________^
216 LL | | } else if input < min {
221 | |_________^ help: replace with clamp: `input.clamp(min, max)`
223 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
224 = note: clamp returns NaN if the input is NaN
226 error: clamp-like pattern without using clamp function
227 --> $DIR/manual_clamp.rs:134:19
229 LL | let x16 = cmp_max(cmp_min(input, CONST_MAX), CONST_MIN);
230 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
232 = note: clamp will panic if max < min
234 error: clamp-like pattern without using clamp function
235 --> $DIR/manual_clamp.rs:135:19
237 LL | let x17 = cmp_min(cmp_max(input, CONST_MIN), CONST_MAX);
238 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
240 = note: clamp will panic if max < min
242 error: clamp-like pattern without using clamp function
243 --> $DIR/manual_clamp.rs:136:19
245 LL | let x18 = cmp_max(CONST_MIN, cmp_min(input, CONST_MAX));
246 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
248 = note: clamp will panic if max < min
250 error: clamp-like pattern without using clamp function
251 --> $DIR/manual_clamp.rs:137:19
253 LL | let x19 = cmp_min(CONST_MAX, cmp_max(input, CONST_MIN));
254 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
256 = note: clamp will panic if max < min
258 error: clamp-like pattern without using clamp function
259 --> $DIR/manual_clamp.rs:138:19
261 LL | let x20 = cmp_max(cmp_min(CONST_MAX, input), CONST_MIN);
262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
264 = note: clamp will panic if max < min
266 error: clamp-like pattern without using clamp function
267 --> $DIR/manual_clamp.rs:139:19
269 LL | let x21 = cmp_min(cmp_max(CONST_MIN, input), CONST_MAX);
270 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
272 = note: clamp will panic if max < min
274 error: clamp-like pattern without using clamp function
275 --> $DIR/manual_clamp.rs:140:19
277 LL | let x22 = cmp_max(CONST_MIN, cmp_min(CONST_MAX, input));
278 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
280 = note: clamp will panic if max < min
282 error: clamp-like pattern without using clamp function
283 --> $DIR/manual_clamp.rs:141:19
285 LL | let x23 = cmp_min(CONST_MAX, cmp_max(CONST_MIN, input));
286 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
288 = note: clamp will panic if max < min
290 error: clamp-like pattern without using clamp function
291 --> $DIR/manual_clamp.rs:143:19
293 LL | let x24 = f64::max(f64::min(input, CONST_F64_MAX), CONST_F64_MIN);
294 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
296 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
297 = note: clamp returns NaN if the input is NaN
299 error: clamp-like pattern without using clamp function
300 --> $DIR/manual_clamp.rs:144:19
302 LL | let x25 = f64::min(f64::max(input, CONST_F64_MIN), CONST_F64_MAX);
303 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
305 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
306 = note: clamp returns NaN if the input is NaN
308 error: clamp-like pattern without using clamp function
309 --> $DIR/manual_clamp.rs:145:19
311 LL | let x26 = f64::max(CONST_F64_MIN, f64::min(input, CONST_F64_MAX));
312 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
314 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
315 = note: clamp returns NaN if the input is NaN
317 error: clamp-like pattern without using clamp function
318 --> $DIR/manual_clamp.rs:146:19
320 LL | let x27 = f64::min(CONST_F64_MAX, f64::max(input, CONST_F64_MIN));
321 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
323 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
324 = note: clamp returns NaN if the input is NaN
326 error: clamp-like pattern without using clamp function
327 --> $DIR/manual_clamp.rs:147:19
329 LL | let x28 = f64::max(f64::min(CONST_F64_MAX, input), CONST_F64_MIN);
330 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
332 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
333 = note: clamp returns NaN if the input is NaN
335 error: clamp-like pattern without using clamp function
336 --> $DIR/manual_clamp.rs:148:19
338 LL | let x29 = f64::min(f64::max(CONST_F64_MIN, input), CONST_F64_MAX);
339 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
341 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
342 = note: clamp returns NaN if the input is NaN
344 error: clamp-like pattern without using clamp function
345 --> $DIR/manual_clamp.rs:149:19
347 LL | let x30 = f64::max(CONST_F64_MIN, f64::min(CONST_F64_MAX, input));
348 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
350 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
351 = note: clamp returns NaN if the input is NaN
353 error: clamp-like pattern without using clamp function
354 --> $DIR/manual_clamp.rs:150:19
356 LL | let x31 = f64::min(CONST_F64_MAX, f64::max(CONST_F64_MIN, input));
357 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
359 = note: clamp will panic if max < min, min.is_nan(), or max.is_nan()
360 = note: clamp returns NaN if the input is NaN
362 error: clamp-like pattern without using clamp function
363 --> $DIR/manual_clamp.rs:153:5
365 LL | / if x32 < min {
367 LL | | } else if x32 > max {
370 | |_____^ help: replace with clamp: `x32 = x32.clamp(min, max);`
372 = note: clamp will panic if max < min
374 error: aborting due to 34 previous errors