1error: clamp-like pattern without using clamp function 2 --> $DIR/manual_clamp.rs:76:5 3 | 4LL | / if x9 < min { 5LL | | x9 = min; 6LL | | } 7LL | | if x9 > max { 8LL | | x9 = max; 9LL | | } 10 | |_____^ help: replace with clamp: `x9 = x9.clamp(min, max);` 11 | 12 = note: clamp will panic if max < min 13 = note: `-D clippy::manual-clamp` implied by `-D warnings` 14 15error: clamp-like pattern without using clamp function 16 --> $DIR/manual_clamp.rs:91:5 17 | 18LL | / if x11 > max { 19LL | | x11 = max; 20LL | | } 21LL | | if x11 < min { 22LL | | x11 = min; 23LL | | } 24 | |_____^ help: replace with clamp: `x11 = x11.clamp(min, max);` 25 | 26 = note: clamp will panic if max < min 27 28error: clamp-like pattern without using clamp function 29 --> $DIR/manual_clamp.rs:99:5 30 | 31LL | / if min > x12 { 32LL | | x12 = min; 33LL | | } 34LL | | if max < x12 { 35LL | | x12 = max; 36LL | | } 37 | |_____^ help: replace with clamp: `x12 = x12.clamp(min, max);` 38 | 39 = note: clamp will panic if max < min 40 41error: clamp-like pattern without using clamp function 42 --> $DIR/manual_clamp.rs:107:5 43 | 44LL | / if max < x13 { 45LL | | x13 = max; 46LL | | } 47LL | | if min > x13 { 48LL | | x13 = min; 49LL | | } 50 | |_____^ help: replace with clamp: `x13 = x13.clamp(min, max);` 51 | 52 = note: clamp will panic if max < min 53 54error: clamp-like pattern without using clamp function 55 --> $DIR/manual_clamp.rs:161:5 56 | 57LL | / if max < x33 { 58LL | | x33 = max; 59LL | | } 60LL | | if min > x33 { 61LL | | x33 = min; 62LL | | } 63 | |_____^ help: replace with clamp: `x33 = x33.clamp(min, max);` 64 | 65 = note: clamp will panic if max < min 66 67error: clamp-like pattern without using clamp function 68 --> $DIR/manual_clamp.rs:21:14 69 | 70LL | let x0 = if max < input { 71 | ______________^ 72LL | | max 73LL | | } else if min > input { 74LL | | min 75LL | | } else { 76LL | | input 77LL | | }; 78 | |_____^ help: replace with clamp: `input.clamp(min, max)` 79 | 80 = note: clamp will panic if max < min 81 82error: clamp-like pattern without using clamp function 83 --> $DIR/manual_clamp.rs:29:14 84 | 85LL | let x1 = if input > max { 86 | ______________^ 87LL | | max 88LL | | } else if input < min { 89LL | | min 90LL | | } else { 91LL | | input 92LL | | }; 93 | |_____^ help: replace with clamp: `input.clamp(min, max)` 94 | 95 = note: clamp will panic if max < min 96 97error: clamp-like pattern without using clamp function 98 --> $DIR/manual_clamp.rs:37:14 99 | 100LL | let x2 = if input < min { 101 | ______________^ 102LL | | min 103LL | | } else if input > max { 104LL | | max 105LL | | } else { 106LL | | input 107LL | | }; 108 | |_____^ help: replace with clamp: `input.clamp(min, max)` 109 | 110 = note: clamp will panic if max < min 111 112error: clamp-like pattern without using clamp function 113 --> $DIR/manual_clamp.rs:45:14 114 | 115LL | let x3 = if min > input { 116 | ______________^ 117LL | | min 118LL | | } else if max < input { 119LL | | max 120LL | | } else { 121LL | | input 122LL | | }; 123 | |_____^ help: replace with clamp: `input.clamp(min, max)` 124 | 125 = note: clamp will panic if max < min 126 127error: clamp-like pattern without using clamp function 128 --> $DIR/manual_clamp.rs:53:14 129 | 130LL | let x4 = input.max(min).min(max); 131 | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)` 132 | 133 = note: clamp will panic if max < min 134 135error: clamp-like pattern without using clamp function 136 --> $DIR/manual_clamp.rs:55:14 137 | 138LL | let x5 = input.min(max).max(min); 139 | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(min, max)` 140 | 141 = note: clamp will panic if max < min 142 143error: clamp-like pattern without using clamp function 144 --> $DIR/manual_clamp.rs:57:14 145 | 146LL | let x6 = match input { 147 | ______________^ 148LL | | x if x > max => max, 149LL | | x if x < min => min, 150LL | | x => x, 151LL | | }; 152 | |_____^ help: replace with clamp: `input.clamp(min, max)` 153 | 154 = note: clamp will panic if max < min 155 156error: clamp-like pattern without using clamp function 157 --> $DIR/manual_clamp.rs:63:14 158 | 159LL | let x7 = match input { 160 | ______________^ 161LL | | x if x < min => min, 162LL | | x if x > max => max, 163LL | | x => x, 164LL | | }; 165 | |_____^ help: replace with clamp: `input.clamp(min, max)` 166 | 167 = note: clamp will panic if max < min 168 169error: clamp-like pattern without using clamp function 170 --> $DIR/manual_clamp.rs:69:14 171 | 172LL | let x8 = match input { 173 | ______________^ 174LL | | x if max < x => max, 175LL | | x if min > x => min, 176LL | | x => x, 177LL | | }; 178 | |_____^ help: replace with clamp: `input.clamp(min, max)` 179 | 180 = note: clamp will panic if max < min 181 182error: clamp-like pattern without using clamp function 183 --> $DIR/manual_clamp.rs:83:15 184 | 185LL | let x10 = match input { 186 | _______________^ 187LL | | x if min > x => min, 188LL | | x if max < x => max, 189LL | | x => x, 190LL | | }; 191 | |_____^ help: replace with clamp: `input.clamp(min, max)` 192 | 193 = note: clamp will panic if max < min 194 195error: clamp-like pattern without using clamp function 196 --> $DIR/manual_clamp.rs:114:15 197 | 198LL | let x14 = if input > CONST_MAX { 199 | _______________^ 200LL | | CONST_MAX 201LL | | } else if input < CONST_MIN { 202LL | | CONST_MIN 203LL | | } else { 204LL | | input 205LL | | }; 206 | |_____^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 207 | 208 = note: clamp will panic if max < min 209 210error: clamp-like pattern without using clamp function 211 --> $DIR/manual_clamp.rs:123:19 212 | 213LL | let x15 = if input > max { 214 | ___________________^ 215LL | | max 216LL | | } else if input < min { 217LL | | min 218LL | | } else { 219LL | | input 220LL | | }; 221 | |_________^ help: replace with clamp: `input.clamp(min, max)` 222 | 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 225 226error: clamp-like pattern without using clamp function 227 --> $DIR/manual_clamp.rs:134:19 228 | 229LL | let x16 = cmp_max(cmp_min(input, CONST_MAX), CONST_MIN); 230 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 231 | 232 = note: clamp will panic if max < min 233 234error: clamp-like pattern without using clamp function 235 --> $DIR/manual_clamp.rs:135:19 236 | 237LL | let x17 = cmp_min(cmp_max(input, CONST_MIN), CONST_MAX); 238 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 239 | 240 = note: clamp will panic if max < min 241 242error: clamp-like pattern without using clamp function 243 --> $DIR/manual_clamp.rs:136:19 244 | 245LL | let x18 = cmp_max(CONST_MIN, cmp_min(input, CONST_MAX)); 246 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 247 | 248 = note: clamp will panic if max < min 249 250error: clamp-like pattern without using clamp function 251 --> $DIR/manual_clamp.rs:137:19 252 | 253LL | let x19 = cmp_min(CONST_MAX, cmp_max(input, CONST_MIN)); 254 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 255 | 256 = note: clamp will panic if max < min 257 258error: clamp-like pattern without using clamp function 259 --> $DIR/manual_clamp.rs:138:19 260 | 261LL | let x20 = cmp_max(cmp_min(CONST_MAX, input), CONST_MIN); 262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 263 | 264 = note: clamp will panic if max < min 265 266error: clamp-like pattern without using clamp function 267 --> $DIR/manual_clamp.rs:139:19 268 | 269LL | let x21 = cmp_min(cmp_max(CONST_MIN, input), CONST_MAX); 270 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 271 | 272 = note: clamp will panic if max < min 273 274error: clamp-like pattern without using clamp function 275 --> $DIR/manual_clamp.rs:140:19 276 | 277LL | let x22 = cmp_max(CONST_MIN, cmp_min(CONST_MAX, input)); 278 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 279 | 280 = note: clamp will panic if max < min 281 282error: clamp-like pattern without using clamp function 283 --> $DIR/manual_clamp.rs:141:19 284 | 285LL | let x23 = cmp_min(CONST_MAX, cmp_max(CONST_MIN, input)); 286 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)` 287 | 288 = note: clamp will panic if max < min 289 290error: clamp-like pattern without using clamp function 291 --> $DIR/manual_clamp.rs:143:19 292 | 293LL | 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)` 295 | 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 298 299error: clamp-like pattern without using clamp function 300 --> $DIR/manual_clamp.rs:144:19 301 | 302LL | 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)` 304 | 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 307 308error: clamp-like pattern without using clamp function 309 --> $DIR/manual_clamp.rs:145:19 310 | 311LL | 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)` 313 | 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 316 317error: clamp-like pattern without using clamp function 318 --> $DIR/manual_clamp.rs:146:19 319 | 320LL | 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)` 322 | 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 325 326error: clamp-like pattern without using clamp function 327 --> $DIR/manual_clamp.rs:147:19 328 | 329LL | 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)` 331 | 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 334 335error: clamp-like pattern without using clamp function 336 --> $DIR/manual_clamp.rs:148:19 337 | 338LL | 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)` 340 | 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 343 344error: clamp-like pattern without using clamp function 345 --> $DIR/manual_clamp.rs:149:19 346 | 347LL | 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)` 349 | 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 352 353error: clamp-like pattern without using clamp function 354 --> $DIR/manual_clamp.rs:150:19 355 | 356LL | 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)` 358 | 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 361 362error: clamp-like pattern without using clamp function 363 --> $DIR/manual_clamp.rs:153:5 364 | 365LL | / if x32 < min { 366LL | | x32 = min; 367LL | | } else if x32 > max { 368LL | | x32 = max; 369LL | | } 370 | |_____^ help: replace with clamp: `x32 = x32.clamp(min, max);` 371 | 372 = note: clamp will panic if max < min 373 374error: clamp-like pattern without using clamp function 375 --> $DIR/manual_clamp.rs:321:13 376 | 377LL | let _ = if input < min { 378 | _____________^ 379LL | | min 380LL | | } else if input > max { 381LL | | max 382LL | | } else { 383LL | | input 384LL | | }; 385 | |_____^ help: replace with clamp: `input.clamp(min, max)` 386 | 387 = note: clamp will panic if max < min 388 389error: aborting due to 35 previous errors 390 391