• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitshifter / glam-rs / 24918269367

25 Apr 2026 12:40AM UTC coverage: 97.134%. Remained the same
24918269367

push

github

bitshifter
Add types are conditional.

57276 of 58966 relevant lines covered (97.13%)

3.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.51
/src/usize/usizevec2.rs
1
// Generated from vec.rs.tera template. Edit the template, not the generated file.
2

3
use crate::{BVec2, U16Vec2, U8Vec2, USizeVec3};
4

5
#[cfg(feature = "i8")]
6
use crate::I8Vec2;
7

8
#[cfg(feature = "i16")]
9
use crate::I16Vec2;
10

11
#[cfg(feature = "i32")]
12
use crate::IVec2;
13

14
#[cfg(feature = "i64")]
15
use crate::I64Vec2;
16

17
#[cfg(feature = "u32")]
18
use crate::UVec2;
19

20
#[cfg(feature = "u64")]
21
use crate::U64Vec2;
22

23
#[cfg(feature = "isize")]
24
use crate::ISizeVec2;
25

26
use core::fmt;
27
use core::iter::{Product, Sum};
28
use core::{f32, ops::*};
29

30
#[cfg(feature = "zerocopy")]
31
use zerocopy_derive::*;
32

33
/// Creates a 2-dimensional vector.
34
#[inline(always)]
35
#[must_use]
36
pub const fn usizevec2(x: usize, y: usize) -> USizeVec2 {
6✔
37
    USizeVec2::new(x, y)
×
38
}
39

40
/// A 2-dimensional vector.
41
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
42
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
43
#[cfg_attr(
44
    feature = "zerocopy",
45
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
46
)]
47
#[cfg_attr(feature = "cuda", repr(align(16)))]
48
#[repr(C)]
49
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
50
pub struct USizeVec2 {
51
    pub x: usize,
52
    pub y: usize,
53
}
54

55
impl USizeVec2 {
56
    /// All zeroes.
57
    pub const ZERO: Self = Self::splat(0);
58

59
    /// All ones.
60
    pub const ONE: Self = Self::splat(1);
61

62
    /// All `usize::MIN`.
63
    pub const MIN: Self = Self::splat(usize::MIN);
64

65
    /// All `usize::MAX`.
66
    pub const MAX: Self = Self::splat(usize::MAX);
67

68
    /// A unit vector pointing along the positive X axis.
69
    pub const X: Self = Self::new(1, 0);
70

71
    /// A unit vector pointing along the positive Y axis.
72
    pub const Y: Self = Self::new(0, 1);
73

74
    /// The unit axes.
75
    pub const AXES: [Self; 2] = [Self::X, Self::Y];
76

77
    /// Creates a new vector.
78
    #[inline(always)]
79
    #[must_use]
80
    pub const fn new(x: usize, y: usize) -> Self {
9✔
81
        Self { x, y }
82
    }
83

84
    /// Creates a vector with all elements set to `v`.
85
    #[inline]
86
    #[must_use]
87
    pub const fn splat(v: usize) -> Self {
3✔
88
        Self { x: v, y: v }
89
    }
90

91
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
92
    #[inline]
93
    #[must_use]
94
    pub fn map<F>(self, f: F) -> Self
6✔
95
    where
96
        F: Fn(usize) -> usize,
97
    {
98
        Self::new(f(self.x), f(self.y))
12✔
99
    }
100

101
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
102
    /// for each element of `self`.
103
    ///
104
    /// A true element in the mask uses the corresponding element from `if_true`, and false
105
    /// uses the element from `if_false`.
106
    #[inline]
107
    #[must_use]
108
    pub fn select(mask: BVec2, if_true: Self, if_false: Self) -> Self {
3✔
109
        Self {
110
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
111
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
112
        }
113
    }
114

115
    /// Creates a new vector from an array.
116
    #[inline]
117
    #[must_use]
118
    pub const fn from_array(a: [usize; 2]) -> Self {
×
119
        Self::new(a[0], a[1])
×
120
    }
121

122
    /// Converts `self` to `[x, y]`
123
    #[inline]
124
    #[must_use]
125
    pub const fn to_array(&self) -> [usize; 2] {
3✔
126
        [self.x, self.y]
3✔
127
    }
128

129
    /// Creates a vector from the first 2 values in `slice`.
130
    ///
131
    /// # Panics
132
    ///
133
    /// Panics if `slice` is less than 2 elements long.
134
    #[inline]
135
    #[must_use]
136
    pub const fn from_slice(slice: &[usize]) -> Self {
3✔
137
        assert!(slice.len() >= 2);
3✔
138
        Self::new(slice[0], slice[1])
3✔
139
    }
140

141
    /// Writes the elements of `self` to the first 2 elements in `slice`.
142
    ///
143
    /// # Panics
144
    ///
145
    /// Panics if `slice` is less than 2 elements long.
146
    #[inline]
147
    pub fn write_to_slice(self, slice: &mut [usize]) {
3✔
148
        slice[..2].copy_from_slice(&self.to_array());
3✔
149
    }
150

151
    /// Creates a 3D vector from `self` and the given `z` value.
152
    #[inline]
153
    #[must_use]
154
    pub const fn extend(self, z: usize) -> USizeVec3 {
3✔
155
        USizeVec3::new(self.x, self.y, z)
3✔
156
    }
157

158
    /// Creates a 2D vector from `self` with the given value of `x`.
159
    #[inline]
160
    #[must_use]
161
    pub fn with_x(mut self, x: usize) -> Self {
3✔
162
        self.x = x;
3✔
163
        self
3✔
164
    }
165

166
    /// Creates a 2D vector from `self` with the given value of `y`.
167
    #[inline]
168
    #[must_use]
169
    pub fn with_y(mut self, y: usize) -> Self {
3✔
170
        self.y = y;
3✔
171
        self
3✔
172
    }
173

174
    /// Computes the dot product of `self` and `rhs`.
175
    #[inline]
176
    #[must_use]
177
    pub fn dot(self, rhs: Self) -> usize {
3✔
178
        (self.x * rhs.x) + (self.y * rhs.y)
3✔
179
    }
180

181
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
182
    #[inline]
183
    #[must_use]
184
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
185
        Self::splat(self.dot(rhs))
3✔
186
    }
187

188
    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
189
    ///
190
    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
191
    #[inline]
192
    #[must_use]
193
    pub fn min(self, rhs: Self) -> Self {
3✔
194
        Self {
195
            x: if self.x < rhs.x { self.x } else { rhs.x },
3✔
196
            y: if self.y < rhs.y { self.y } else { rhs.y },
3✔
197
        }
198
    }
199

200
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
201
    ///
202
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
203
    #[inline]
204
    #[must_use]
205
    pub fn max(self, rhs: Self) -> Self {
3✔
206
        Self {
207
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
208
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
209
        }
210
    }
211

212
    /// Component-wise clamping of values, similar to [`usize::clamp`].
213
    ///
214
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
215
    ///
216
    /// # Panics
217
    ///
218
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
219
    #[inline]
220
    #[must_use]
221
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
222
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
223
        self.max(min).min(max)
3✔
224
    }
225

226
    /// Returns the horizontal minimum of `self`.
227
    ///
228
    /// In other words this computes `min(x, y, ..)`.
229
    #[inline]
230
    #[must_use]
231
    pub fn min_element(self) -> usize {
3✔
232
        let min = |a, b| if a < b { a } else { b };
6✔
233
        min(self.x, self.y)
3✔
234
    }
235

236
    /// Returns the horizontal maximum of `self`.
237
    ///
238
    /// In other words this computes `max(x, y, ..)`.
239
    #[inline]
240
    #[must_use]
241
    pub fn max_element(self) -> usize {
3✔
242
        let max = |a, b| if a > b { a } else { b };
6✔
243
        max(self.x, self.y)
3✔
244
    }
245

246
    /// Returns the index of the first minimum element of `self`.
247
    #[doc(alias = "argmin")]
248
    #[inline]
249
    #[must_use]
250
    pub fn min_position(self) -> usize {
3✔
251
        if self.x <= self.y {
6✔
252
            0
3✔
253
        } else {
254
            1
3✔
255
        }
256
    }
257

258
    /// Returns the index of the first maximum element of `self`.
259
    #[doc(alias = "argmax")]
260
    #[inline]
261
    #[must_use]
262
    pub fn max_position(self) -> usize {
3✔
263
        if self.x >= self.y {
6✔
264
            0
3✔
265
        } else {
266
            1
3✔
267
        }
268
    }
269

270
    /// Returns the sum of all elements of `self`.
271
    ///
272
    /// In other words, this computes `self.x + self.y + ..`.
273
    #[inline]
274
    #[must_use]
275
    pub fn element_sum(self) -> usize {
3✔
276
        self.x + self.y
3✔
277
    }
278

279
    /// Returns the product of all elements of `self`.
280
    ///
281
    /// In other words, this computes `self.x * self.y * ..`.
282
    #[inline]
283
    #[must_use]
284
    pub fn element_product(self) -> usize {
3✔
285
        self.x * self.y
3✔
286
    }
287

288
    /// Returns a vector mask containing the result of a `==` comparison for each element of
289
    /// `self` and `rhs`.
290
    ///
291
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
292
    /// elements.
293
    #[inline]
294
    #[must_use]
295
    pub fn cmpeq(self, rhs: Self) -> BVec2 {
3✔
296
        BVec2::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y))
3✔
297
    }
298

299
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
300
    /// `self` and `rhs`.
301
    ///
302
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
303
    /// elements.
304
    #[inline]
305
    #[must_use]
306
    pub fn cmpne(self, rhs: Self) -> BVec2 {
3✔
307
        BVec2::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y))
3✔
308
    }
309

310
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
311
    /// `self` and `rhs`.
312
    ///
313
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
314
    /// elements.
315
    #[inline]
316
    #[must_use]
317
    pub fn cmpge(self, rhs: Self) -> BVec2 {
3✔
318
        BVec2::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y))
3✔
319
    }
320

321
    /// Returns a vector mask containing the result of a `>` comparison for each element of
322
    /// `self` and `rhs`.
323
    ///
324
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
325
    /// elements.
326
    #[inline]
327
    #[must_use]
328
    pub fn cmpgt(self, rhs: Self) -> BVec2 {
3✔
329
        BVec2::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y))
3✔
330
    }
331

332
    /// Returns a vector mask containing the result of a `<=` comparison for each element of
333
    /// `self` and `rhs`.
334
    ///
335
    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
336
    /// elements.
337
    #[inline]
338
    #[must_use]
339
    pub fn cmple(self, rhs: Self) -> BVec2 {
3✔
340
        BVec2::new(self.x.le(&rhs.x), self.y.le(&rhs.y))
3✔
341
    }
342

343
    /// Returns a vector mask containing the result of a `<` comparison for each element of
344
    /// `self` and `rhs`.
345
    ///
346
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
347
    /// elements.
348
    #[inline]
349
    #[must_use]
350
    pub fn cmplt(self, rhs: Self) -> BVec2 {
3✔
351
        BVec2::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y))
3✔
352
    }
353

354
    /// Computes the squared length of `self`.
355
    #[doc(alias = "magnitude2")]
356
    #[inline]
357
    #[must_use]
358
    pub fn length_squared(self) -> usize {
3✔
359
        self.dot(self)
3✔
360
    }
361

362
    /// Computes the [manhattan distance] between two points.
363
    ///
364
    /// # Overflow
365
    /// This method may overflow if the result is greater than [`usize::MAX`].
366
    ///
367
    /// See also [`checked_manhattan_distance`][USizeVec2::checked_manhattan_distance].
368
    ///
369
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
370
    #[inline]
371
    #[must_use]
372
    pub fn manhattan_distance(self, rhs: Self) -> usize {
3✔
373
        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y)
3✔
374
    }
375

376
    /// Computes the [manhattan distance] between two points.
377
    ///
378
    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
379
    ///
380
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
381
    #[inline]
382
    #[must_use]
383
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
3✔
384
        let d = self.x.abs_diff(rhs.x);
3✔
385
        d.checked_add(self.y.abs_diff(rhs.y))
3✔
386
    }
387

388
    /// Computes the [chebyshev distance] between two points.
389
    ///
390
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
391
    #[inline]
392
    #[must_use]
393
    pub fn chebyshev_distance(self, rhs: Self) -> usize {
3✔
394
        // Note: the compiler will eventually optimize out the loop
395
        [self.x.abs_diff(rhs.x), self.y.abs_diff(rhs.y)]
3✔
396
            .into_iter()
397
            .max()
398
            .unwrap()
399
    }
400

401
    /// Casts all elements of `self` to `f32`.
402
    #[inline]
403
    #[must_use]
404
    pub fn as_vec2(self) -> crate::Vec2 {
3✔
405
        crate::Vec2::new(self.x as f32, self.y as f32)
9✔
406
    }
407

408
    /// Casts all elements of `self` to `f64`.
409
    #[cfg(feature = "f64")]
410
    #[inline]
411
    #[must_use]
412
    pub fn as_dvec2(self) -> crate::DVec2 {
3✔
413
        crate::DVec2::new(self.x as f64, self.y as f64)
3✔
414
    }
415

416
    /// Casts all elements of `self` to `i8`.
417
    #[cfg(feature = "i8")]
418
    #[inline]
419
    #[must_use]
420
    pub fn as_i8vec2(self) -> crate::I8Vec2 {
3✔
421
        crate::I8Vec2::new(self.x as i8, self.y as i8)
3✔
422
    }
423

424
    /// Casts all elements of `self` to `u8`.
425
    #[cfg(feature = "u8")]
426
    #[inline]
427
    #[must_use]
428
    pub fn as_u8vec2(self) -> crate::U8Vec2 {
3✔
429
        crate::U8Vec2::new(self.x as u8, self.y as u8)
3✔
430
    }
431

432
    /// Casts all elements of `self` to `i16`.
433
    #[cfg(feature = "i16")]
434
    #[inline]
435
    #[must_use]
436
    pub fn as_i16vec2(self) -> crate::I16Vec2 {
3✔
437
        crate::I16Vec2::new(self.x as i16, self.y as i16)
3✔
438
    }
439

440
    /// Casts all elements of `self` to `u16`.
441
    #[cfg(feature = "u16")]
442
    #[inline]
443
    #[must_use]
444
    pub fn as_u16vec2(self) -> crate::U16Vec2 {
3✔
445
        crate::U16Vec2::new(self.x as u16, self.y as u16)
3✔
446
    }
447

448
    /// Casts all elements of `self` to `i32`.
449
    #[cfg(feature = "i32")]
450
    #[inline]
451
    #[must_use]
452
    pub fn as_ivec2(self) -> crate::IVec2 {
3✔
453
        crate::IVec2::new(self.x as i32, self.y as i32)
3✔
454
    }
455

456
    /// Casts all elements of `self` to `u32`.
457
    #[cfg(feature = "u32")]
458
    #[inline]
459
    #[must_use]
460
    pub fn as_uvec2(self) -> crate::UVec2 {
3✔
461
        crate::UVec2::new(self.x as u32, self.y as u32)
3✔
462
    }
463

464
    /// Casts all elements of `self` to `i64`.
465
    #[cfg(feature = "i64")]
466
    #[inline]
467
    #[must_use]
468
    pub fn as_i64vec2(self) -> crate::I64Vec2 {
3✔
469
        crate::I64Vec2::new(self.x as i64, self.y as i64)
3✔
470
    }
471

472
    /// Casts all elements of `self` to `u64`.
473
    #[cfg(feature = "u64")]
474
    #[inline]
475
    #[must_use]
476
    pub fn as_u64vec2(self) -> crate::U64Vec2 {
3✔
477
        crate::U64Vec2::new(self.x as u64, self.y as u64)
3✔
478
    }
479

480
    /// Casts all elements of `self` to `isize`.
481
    #[cfg(feature = "isize")]
482
    #[inline]
483
    #[must_use]
484
    pub fn as_isizevec2(self) -> crate::ISizeVec2 {
3✔
485
        crate::ISizeVec2::new(self.x as isize, self.y as isize)
3✔
486
    }
487

488
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
489
    ///
490
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
491
    #[inline]
492
    #[must_use]
493
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
494
        let x = match self.x.checked_add(rhs.x) {
3✔
495
            Some(v) => v,
3✔
496
            None => return None,
3✔
497
        };
498
        let y = match self.y.checked_add(rhs.y) {
3✔
499
            Some(v) => v,
3✔
500
            None => return None,
3✔
501
        };
502

503
        Some(Self { x, y })
3✔
504
    }
505

506
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
507
    ///
508
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
509
    #[inline]
510
    #[must_use]
511
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
512
        let x = match self.x.checked_sub(rhs.x) {
3✔
513
            Some(v) => v,
3✔
514
            None => return None,
3✔
515
        };
516
        let y = match self.y.checked_sub(rhs.y) {
3✔
517
            Some(v) => v,
3✔
518
            None => return None,
3✔
519
        };
520

521
        Some(Self { x, y })
3✔
522
    }
523

524
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
525
    ///
526
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
527
    #[inline]
528
    #[must_use]
529
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
530
        let x = match self.x.checked_mul(rhs.x) {
3✔
531
            Some(v) => v,
3✔
532
            None => return None,
3✔
533
        };
534
        let y = match self.y.checked_mul(rhs.y) {
3✔
535
            Some(v) => v,
3✔
536
            None => return None,
×
537
        };
538

539
        Some(Self { x, y })
3✔
540
    }
541

542
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
543
    ///
544
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
545
    #[inline]
546
    #[must_use]
547
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
548
        let x = match self.x.checked_div(rhs.x) {
3✔
549
            Some(v) => v,
3✔
550
            None => return None,
3✔
551
        };
552
        let y = match self.y.checked_div(rhs.y) {
3✔
553
            Some(v) => v,
3✔
554
            None => return None,
3✔
555
        };
556

557
        Some(Self { x, y })
3✔
558
    }
559

560
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
561
    ///
562
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
563
    #[inline]
564
    #[must_use]
565
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
566
        Self {
567
            x: self.x.wrapping_add(rhs.x),
3✔
568
            y: self.y.wrapping_add(rhs.y),
3✔
569
        }
570
    }
571

572
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
573
    ///
574
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
575
    #[inline]
576
    #[must_use]
577
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
578
        Self {
579
            x: self.x.wrapping_sub(rhs.x),
3✔
580
            y: self.y.wrapping_sub(rhs.y),
3✔
581
        }
582
    }
583

584
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
585
    ///
586
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
587
    #[inline]
588
    #[must_use]
589
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
590
        Self {
591
            x: self.x.wrapping_mul(rhs.x),
3✔
592
            y: self.y.wrapping_mul(rhs.y),
3✔
593
        }
594
    }
595

596
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
597
    ///
598
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
599
    #[inline]
600
    #[must_use]
601
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
602
        Self {
603
            x: self.x.wrapping_div(rhs.x),
3✔
604
            y: self.y.wrapping_div(rhs.y),
3✔
605
        }
606
    }
607

608
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
609
    ///
610
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
611
    #[inline]
612
    #[must_use]
613
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
614
        Self {
615
            x: self.x.saturating_add(rhs.x),
3✔
616
            y: self.y.saturating_add(rhs.y),
3✔
617
        }
618
    }
619

620
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
621
    ///
622
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
623
    #[inline]
624
    #[must_use]
625
    pub const fn saturating_sub(self, rhs: Self) -> Self {
3✔
626
        Self {
627
            x: self.x.saturating_sub(rhs.x),
3✔
628
            y: self.y.saturating_sub(rhs.y),
3✔
629
        }
630
    }
631

632
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
633
    ///
634
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
635
    #[inline]
636
    #[must_use]
637
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
638
        Self {
639
            x: self.x.saturating_mul(rhs.x),
3✔
640
            y: self.y.saturating_mul(rhs.y),
3✔
641
        }
642
    }
643

644
    /// Returns a vector containing the saturating division of `self` and `rhs`.
645
    ///
646
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
647
    #[inline]
648
    #[must_use]
649
    pub const fn saturating_div(self, rhs: Self) -> Self {
3✔
650
        Self {
651
            x: self.x.saturating_div(rhs.x),
3✔
652
            y: self.y.saturating_div(rhs.y),
3✔
653
        }
654
    }
655

656
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
657
    ///
658
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
659

660
    #[cfg(feature = "isize")]
661
    #[inline]
662
    #[must_use]
663
    pub const fn checked_add_signed(self, rhs: ISizeVec2) -> Option<Self> {
3✔
664
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
665
            Some(v) => v,
3✔
666
            None => return None,
3✔
667
        };
668
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
669
            Some(v) => v,
3✔
670
            None => return None,
×
671
        };
672

673
        Some(Self { x, y })
3✔
674
    }
675

676
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
677
    ///
678
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
679

680
    #[cfg(feature = "isize")]
681
    #[inline]
682
    #[must_use]
683
    pub const fn wrapping_add_signed(self, rhs: ISizeVec2) -> Self {
3✔
684
        Self {
685
            x: self.x.wrapping_add_signed(rhs.x),
3✔
686
            y: self.y.wrapping_add_signed(rhs.y),
3✔
687
        }
688
    }
689

690
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
691
    ///
692
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
693

694
    #[cfg(feature = "isize")]
695
    #[inline]
696
    #[must_use]
697
    pub const fn saturating_add_signed(self, rhs: ISizeVec2) -> Self {
3✔
698
        Self {
699
            x: self.x.saturating_add_signed(rhs.x),
3✔
700
            y: self.y.saturating_add_signed(rhs.y),
3✔
701
        }
702
    }
703
}
704

705
impl Default for USizeVec2 {
706
    #[inline(always)]
707
    fn default() -> Self {
3✔
708
        Self::ZERO
×
709
    }
710
}
711

712
impl Div for USizeVec2 {
713
    type Output = Self;
714
    #[inline]
715
    fn div(self, rhs: Self) -> Self {
3✔
716
        Self {
717
            x: self.x.div(rhs.x),
3✔
718
            y: self.y.div(rhs.y),
3✔
719
        }
720
    }
721
}
722

723
impl Div<&Self> for USizeVec2 {
724
    type Output = Self;
725
    #[inline]
726
    fn div(self, rhs: &Self) -> Self {
3✔
727
        self.div(*rhs)
3✔
728
    }
729
}
730

731
impl Div<&USizeVec2> for &USizeVec2 {
732
    type Output = USizeVec2;
733
    #[inline]
734
    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
735
        (*self).div(*rhs)
3✔
736
    }
737
}
738

739
impl Div<USizeVec2> for &USizeVec2 {
740
    type Output = USizeVec2;
741
    #[inline]
742
    fn div(self, rhs: USizeVec2) -> USizeVec2 {
3✔
743
        (*self).div(rhs)
3✔
744
    }
745
}
746

747
impl DivAssign for USizeVec2 {
748
    #[inline]
749
    fn div_assign(&mut self, rhs: Self) {
3✔
750
        self.x.div_assign(rhs.x);
3✔
751
        self.y.div_assign(rhs.y);
6✔
752
    }
753
}
754

755
impl DivAssign<&Self> for USizeVec2 {
756
    #[inline]
757
    fn div_assign(&mut self, rhs: &Self) {
3✔
758
        self.div_assign(*rhs);
3✔
759
    }
760
}
761

762
impl Div<usize> for USizeVec2 {
763
    type Output = Self;
764
    #[inline]
765
    fn div(self, rhs: usize) -> Self {
3✔
766
        Self {
767
            x: self.x.div(rhs),
3✔
768
            y: self.y.div(rhs),
3✔
769
        }
770
    }
771
}
772

773
impl Div<&usize> for USizeVec2 {
774
    type Output = Self;
775
    #[inline]
776
    fn div(self, rhs: &usize) -> Self {
3✔
777
        self.div(*rhs)
3✔
778
    }
779
}
780

781
impl Div<&usize> for &USizeVec2 {
782
    type Output = USizeVec2;
783
    #[inline]
784
    fn div(self, rhs: &usize) -> USizeVec2 {
3✔
785
        (*self).div(*rhs)
3✔
786
    }
787
}
788

789
impl Div<usize> for &USizeVec2 {
790
    type Output = USizeVec2;
791
    #[inline]
792
    fn div(self, rhs: usize) -> USizeVec2 {
3✔
793
        (*self).div(rhs)
3✔
794
    }
795
}
796

797
impl DivAssign<usize> for USizeVec2 {
798
    #[inline]
799
    fn div_assign(&mut self, rhs: usize) {
3✔
800
        self.x.div_assign(rhs);
3✔
801
        self.y.div_assign(rhs);
6✔
802
    }
803
}
804

805
impl DivAssign<&usize> for USizeVec2 {
806
    #[inline]
807
    fn div_assign(&mut self, rhs: &usize) {
3✔
808
        self.div_assign(*rhs);
3✔
809
    }
810
}
811

812
impl Div<USizeVec2> for usize {
813
    type Output = USizeVec2;
814
    #[inline]
815
    fn div(self, rhs: USizeVec2) -> USizeVec2 {
3✔
816
        USizeVec2 {
817
            x: self.div(rhs.x),
3✔
818
            y: self.div(rhs.y),
3✔
819
        }
820
    }
821
}
822

823
impl Div<&USizeVec2> for usize {
824
    type Output = USizeVec2;
825
    #[inline]
826
    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
827
        self.div(*rhs)
3✔
828
    }
829
}
830

831
impl Div<&USizeVec2> for &usize {
832
    type Output = USizeVec2;
833
    #[inline]
834
    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
835
        (*self).div(*rhs)
3✔
836
    }
837
}
838

839
impl Div<USizeVec2> for &usize {
840
    type Output = USizeVec2;
841
    #[inline]
842
    fn div(self, rhs: USizeVec2) -> USizeVec2 {
3✔
843
        (*self).div(rhs)
3✔
844
    }
845
}
846

847
impl Mul for USizeVec2 {
848
    type Output = Self;
849
    #[inline]
850
    fn mul(self, rhs: Self) -> Self {
3✔
851
        Self {
852
            x: self.x.mul(rhs.x),
3✔
853
            y: self.y.mul(rhs.y),
6✔
854
        }
855
    }
856
}
857

858
impl Mul<&Self> for USizeVec2 {
859
    type Output = Self;
860
    #[inline]
861
    fn mul(self, rhs: &Self) -> Self {
3✔
862
        self.mul(*rhs)
3✔
863
    }
864
}
865

866
impl Mul<&USizeVec2> for &USizeVec2 {
867
    type Output = USizeVec2;
868
    #[inline]
869
    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
870
        (*self).mul(*rhs)
3✔
871
    }
872
}
873

874
impl Mul<USizeVec2> for &USizeVec2 {
875
    type Output = USizeVec2;
876
    #[inline]
877
    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
3✔
878
        (*self).mul(rhs)
3✔
879
    }
880
}
881

882
impl MulAssign for USizeVec2 {
883
    #[inline]
884
    fn mul_assign(&mut self, rhs: Self) {
3✔
885
        self.x.mul_assign(rhs.x);
3✔
886
        self.y.mul_assign(rhs.y);
6✔
887
    }
888
}
889

890
impl MulAssign<&Self> for USizeVec2 {
891
    #[inline]
892
    fn mul_assign(&mut self, rhs: &Self) {
3✔
893
        self.mul_assign(*rhs);
3✔
894
    }
895
}
896

897
impl Mul<usize> for USizeVec2 {
898
    type Output = Self;
899
    #[inline]
900
    fn mul(self, rhs: usize) -> Self {
3✔
901
        Self {
902
            x: self.x.mul(rhs),
3✔
903
            y: self.y.mul(rhs),
3✔
904
        }
905
    }
906
}
907

908
impl Mul<&usize> for USizeVec2 {
909
    type Output = Self;
910
    #[inline]
911
    fn mul(self, rhs: &usize) -> Self {
3✔
912
        self.mul(*rhs)
3✔
913
    }
914
}
915

916
impl Mul<&usize> for &USizeVec2 {
917
    type Output = USizeVec2;
918
    #[inline]
919
    fn mul(self, rhs: &usize) -> USizeVec2 {
3✔
920
        (*self).mul(*rhs)
3✔
921
    }
922
}
923

924
impl Mul<usize> for &USizeVec2 {
925
    type Output = USizeVec2;
926
    #[inline]
927
    fn mul(self, rhs: usize) -> USizeVec2 {
3✔
928
        (*self).mul(rhs)
3✔
929
    }
930
}
931

932
impl MulAssign<usize> for USizeVec2 {
933
    #[inline]
934
    fn mul_assign(&mut self, rhs: usize) {
3✔
935
        self.x.mul_assign(rhs);
3✔
936
        self.y.mul_assign(rhs);
5✔
937
    }
938
}
939

940
impl MulAssign<&usize> for USizeVec2 {
941
    #[inline]
942
    fn mul_assign(&mut self, rhs: &usize) {
3✔
943
        self.mul_assign(*rhs);
3✔
944
    }
945
}
946

947
impl Mul<USizeVec2> for usize {
948
    type Output = USizeVec2;
949
    #[inline]
950
    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
3✔
951
        USizeVec2 {
952
            x: self.mul(rhs.x),
3✔
953
            y: self.mul(rhs.y),
3✔
954
        }
955
    }
956
}
957

958
impl Mul<&USizeVec2> for usize {
959
    type Output = USizeVec2;
960
    #[inline]
961
    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
962
        self.mul(*rhs)
3✔
963
    }
964
}
965

966
impl Mul<&USizeVec2> for &usize {
967
    type Output = USizeVec2;
968
    #[inline]
969
    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
970
        (*self).mul(*rhs)
3✔
971
    }
972
}
973

974
impl Mul<USizeVec2> for &usize {
975
    type Output = USizeVec2;
976
    #[inline]
977
    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
3✔
978
        (*self).mul(rhs)
3✔
979
    }
980
}
981

982
impl Add for USizeVec2 {
983
    type Output = Self;
984
    #[inline]
985
    fn add(self, rhs: Self) -> Self {
3✔
986
        Self {
987
            x: self.x.add(rhs.x),
3✔
988
            y: self.y.add(rhs.y),
3✔
989
        }
990
    }
991
}
992

993
impl Add<&Self> for USizeVec2 {
994
    type Output = Self;
995
    #[inline]
996
    fn add(self, rhs: &Self) -> Self {
3✔
997
        self.add(*rhs)
3✔
998
    }
999
}
1000

1001
impl Add<&USizeVec2> for &USizeVec2 {
1002
    type Output = USizeVec2;
1003
    #[inline]
1004
    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1005
        (*self).add(*rhs)
3✔
1006
    }
1007
}
1008

1009
impl Add<USizeVec2> for &USizeVec2 {
1010
    type Output = USizeVec2;
1011
    #[inline]
1012
    fn add(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1013
        (*self).add(rhs)
3✔
1014
    }
1015
}
1016

1017
impl AddAssign for USizeVec2 {
1018
    #[inline]
1019
    fn add_assign(&mut self, rhs: Self) {
3✔
1020
        self.x.add_assign(rhs.x);
3✔
1021
        self.y.add_assign(rhs.y);
6✔
1022
    }
1023
}
1024

1025
impl AddAssign<&Self> for USizeVec2 {
1026
    #[inline]
1027
    fn add_assign(&mut self, rhs: &Self) {
3✔
1028
        self.add_assign(*rhs);
3✔
1029
    }
1030
}
1031

1032
impl Add<usize> for USizeVec2 {
1033
    type Output = Self;
1034
    #[inline]
1035
    fn add(self, rhs: usize) -> Self {
3✔
1036
        Self {
1037
            x: self.x.add(rhs),
3✔
1038
            y: self.y.add(rhs),
3✔
1039
        }
1040
    }
1041
}
1042

1043
impl Add<&usize> for USizeVec2 {
1044
    type Output = Self;
1045
    #[inline]
1046
    fn add(self, rhs: &usize) -> Self {
3✔
1047
        self.add(*rhs)
3✔
1048
    }
1049
}
1050

1051
impl Add<&usize> for &USizeVec2 {
1052
    type Output = USizeVec2;
1053
    #[inline]
1054
    fn add(self, rhs: &usize) -> USizeVec2 {
3✔
1055
        (*self).add(*rhs)
3✔
1056
    }
1057
}
1058

1059
impl Add<usize> for &USizeVec2 {
1060
    type Output = USizeVec2;
1061
    #[inline]
1062
    fn add(self, rhs: usize) -> USizeVec2 {
3✔
1063
        (*self).add(rhs)
3✔
1064
    }
1065
}
1066

1067
impl AddAssign<usize> for USizeVec2 {
1068
    #[inline]
1069
    fn add_assign(&mut self, rhs: usize) {
3✔
1070
        self.x.add_assign(rhs);
3✔
1071
        self.y.add_assign(rhs);
3✔
1072
    }
1073
}
1074

1075
impl AddAssign<&usize> for USizeVec2 {
1076
    #[inline]
1077
    fn add_assign(&mut self, rhs: &usize) {
3✔
1078
        self.add_assign(*rhs);
3✔
1079
    }
1080
}
1081

1082
impl Add<USizeVec2> for usize {
1083
    type Output = USizeVec2;
1084
    #[inline]
1085
    fn add(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1086
        USizeVec2 {
1087
            x: self.add(rhs.x),
3✔
1088
            y: self.add(rhs.y),
3✔
1089
        }
1090
    }
1091
}
1092

1093
impl Add<&USizeVec2> for usize {
1094
    type Output = USizeVec2;
1095
    #[inline]
1096
    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1097
        self.add(*rhs)
3✔
1098
    }
1099
}
1100

1101
impl Add<&USizeVec2> for &usize {
1102
    type Output = USizeVec2;
1103
    #[inline]
1104
    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1105
        (*self).add(*rhs)
3✔
1106
    }
1107
}
1108

1109
impl Add<USizeVec2> for &usize {
1110
    type Output = USizeVec2;
1111
    #[inline]
1112
    fn add(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1113
        (*self).add(rhs)
3✔
1114
    }
1115
}
1116

1117
impl Sub for USizeVec2 {
1118
    type Output = Self;
1119
    #[inline]
1120
    fn sub(self, rhs: Self) -> Self {
3✔
1121
        Self {
1122
            x: self.x.sub(rhs.x),
3✔
1123
            y: self.y.sub(rhs.y),
3✔
1124
        }
1125
    }
1126
}
1127

1128
impl Sub<&Self> for USizeVec2 {
1129
    type Output = Self;
1130
    #[inline]
1131
    fn sub(self, rhs: &Self) -> Self {
3✔
1132
        self.sub(*rhs)
3✔
1133
    }
1134
}
1135

1136
impl Sub<&USizeVec2> for &USizeVec2 {
1137
    type Output = USizeVec2;
1138
    #[inline]
1139
    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1140
        (*self).sub(*rhs)
3✔
1141
    }
1142
}
1143

1144
impl Sub<USizeVec2> for &USizeVec2 {
1145
    type Output = USizeVec2;
1146
    #[inline]
1147
    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1148
        (*self).sub(rhs)
3✔
1149
    }
1150
}
1151

1152
impl SubAssign for USizeVec2 {
1153
    #[inline]
1154
    fn sub_assign(&mut self, rhs: Self) {
3✔
1155
        self.x.sub_assign(rhs.x);
3✔
1156
        self.y.sub_assign(rhs.y);
6✔
1157
    }
1158
}
1159

1160
impl SubAssign<&Self> for USizeVec2 {
1161
    #[inline]
1162
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1163
        self.sub_assign(*rhs);
3✔
1164
    }
1165
}
1166

1167
impl Sub<usize> for USizeVec2 {
1168
    type Output = Self;
1169
    #[inline]
1170
    fn sub(self, rhs: usize) -> Self {
4✔
1171
        Self {
1172
            x: self.x.sub(rhs),
6✔
1173
            y: self.y.sub(rhs),
6✔
1174
        }
1175
    }
1176
}
1177

1178
impl Sub<&usize> for USizeVec2 {
1179
    type Output = Self;
1180
    #[inline]
1181
    fn sub(self, rhs: &usize) -> Self {
3✔
1182
        self.sub(*rhs)
3✔
1183
    }
1184
}
1185

1186
impl Sub<&usize> for &USizeVec2 {
1187
    type Output = USizeVec2;
1188
    #[inline]
1189
    fn sub(self, rhs: &usize) -> USizeVec2 {
3✔
1190
        (*self).sub(*rhs)
3✔
1191
    }
1192
}
1193

1194
impl Sub<usize> for &USizeVec2 {
1195
    type Output = USizeVec2;
1196
    #[inline]
1197
    fn sub(self, rhs: usize) -> USizeVec2 {
3✔
1198
        (*self).sub(rhs)
3✔
1199
    }
1200
}
1201

1202
impl SubAssign<usize> for USizeVec2 {
1203
    #[inline]
1204
    fn sub_assign(&mut self, rhs: usize) {
3✔
1205
        self.x.sub_assign(rhs);
3✔
1206
        self.y.sub_assign(rhs);
5✔
1207
    }
1208
}
1209

1210
impl SubAssign<&usize> for USizeVec2 {
1211
    #[inline]
1212
    fn sub_assign(&mut self, rhs: &usize) {
3✔
1213
        self.sub_assign(*rhs);
3✔
1214
    }
1215
}
1216

1217
impl Sub<USizeVec2> for usize {
1218
    type Output = USizeVec2;
1219
    #[inline]
1220
    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1221
        USizeVec2 {
1222
            x: self.sub(rhs.x),
3✔
1223
            y: self.sub(rhs.y),
3✔
1224
        }
1225
    }
1226
}
1227

1228
impl Sub<&USizeVec2> for usize {
1229
    type Output = USizeVec2;
1230
    #[inline]
1231
    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1232
        self.sub(*rhs)
3✔
1233
    }
1234
}
1235

1236
impl Sub<&USizeVec2> for &usize {
1237
    type Output = USizeVec2;
1238
    #[inline]
1239
    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1240
        (*self).sub(*rhs)
3✔
1241
    }
1242
}
1243

1244
impl Sub<USizeVec2> for &usize {
1245
    type Output = USizeVec2;
1246
    #[inline]
1247
    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1248
        (*self).sub(rhs)
3✔
1249
    }
1250
}
1251

1252
impl Rem for USizeVec2 {
1253
    type Output = Self;
1254
    #[inline]
1255
    fn rem(self, rhs: Self) -> Self {
3✔
1256
        Self {
1257
            x: self.x.rem(rhs.x),
3✔
1258
            y: self.y.rem(rhs.y),
3✔
1259
        }
1260
    }
1261
}
1262

1263
impl Rem<&Self> for USizeVec2 {
1264
    type Output = Self;
1265
    #[inline]
1266
    fn rem(self, rhs: &Self) -> Self {
3✔
1267
        self.rem(*rhs)
3✔
1268
    }
1269
}
1270

1271
impl Rem<&USizeVec2> for &USizeVec2 {
1272
    type Output = USizeVec2;
1273
    #[inline]
1274
    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1275
        (*self).rem(*rhs)
3✔
1276
    }
1277
}
1278

1279
impl Rem<USizeVec2> for &USizeVec2 {
1280
    type Output = USizeVec2;
1281
    #[inline]
1282
    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1283
        (*self).rem(rhs)
3✔
1284
    }
1285
}
1286

1287
impl RemAssign for USizeVec2 {
1288
    #[inline]
1289
    fn rem_assign(&mut self, rhs: Self) {
3✔
1290
        self.x.rem_assign(rhs.x);
5✔
1291
        self.y.rem_assign(rhs.y);
5✔
1292
    }
1293
}
1294

1295
impl RemAssign<&Self> for USizeVec2 {
1296
    #[inline]
1297
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1298
        self.rem_assign(*rhs);
3✔
1299
    }
1300
}
1301

1302
impl Rem<usize> for USizeVec2 {
1303
    type Output = Self;
1304
    #[inline]
1305
    fn rem(self, rhs: usize) -> Self {
3✔
1306
        Self {
1307
            x: self.x.rem(rhs),
3✔
1308
            y: self.y.rem(rhs),
3✔
1309
        }
1310
    }
1311
}
1312

1313
impl Rem<&usize> for USizeVec2 {
1314
    type Output = Self;
1315
    #[inline]
1316
    fn rem(self, rhs: &usize) -> Self {
3✔
1317
        self.rem(*rhs)
3✔
1318
    }
1319
}
1320

1321
impl Rem<&usize> for &USizeVec2 {
1322
    type Output = USizeVec2;
1323
    #[inline]
1324
    fn rem(self, rhs: &usize) -> USizeVec2 {
3✔
1325
        (*self).rem(*rhs)
3✔
1326
    }
1327
}
1328

1329
impl Rem<usize> for &USizeVec2 {
1330
    type Output = USizeVec2;
1331
    #[inline]
1332
    fn rem(self, rhs: usize) -> USizeVec2 {
3✔
1333
        (*self).rem(rhs)
3✔
1334
    }
1335
}
1336

1337
impl RemAssign<usize> for USizeVec2 {
1338
    #[inline]
1339
    fn rem_assign(&mut self, rhs: usize) {
3✔
1340
        self.x.rem_assign(rhs);
3✔
1341
        self.y.rem_assign(rhs);
6✔
1342
    }
1343
}
1344

1345
impl RemAssign<&usize> for USizeVec2 {
1346
    #[inline]
1347
    fn rem_assign(&mut self, rhs: &usize) {
3✔
1348
        self.rem_assign(*rhs);
3✔
1349
    }
1350
}
1351

1352
impl Rem<USizeVec2> for usize {
1353
    type Output = USizeVec2;
1354
    #[inline]
1355
    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1356
        USizeVec2 {
1357
            x: self.rem(rhs.x),
3✔
1358
            y: self.rem(rhs.y),
3✔
1359
        }
1360
    }
1361
}
1362

1363
impl Rem<&USizeVec2> for usize {
1364
    type Output = USizeVec2;
1365
    #[inline]
1366
    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1367
        self.rem(*rhs)
3✔
1368
    }
1369
}
1370

1371
impl Rem<&USizeVec2> for &usize {
1372
    type Output = USizeVec2;
1373
    #[inline]
1374
    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1375
        (*self).rem(*rhs)
3✔
1376
    }
1377
}
1378

1379
impl Rem<USizeVec2> for &usize {
1380
    type Output = USizeVec2;
1381
    #[inline]
1382
    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1383
        (*self).rem(rhs)
3✔
1384
    }
1385
}
1386

1387
impl AsRef<[usize; 2]> for USizeVec2 {
1388
    #[inline]
1389
    fn as_ref(&self) -> &[usize; 2] {
3✔
1390
        unsafe { &*(self as *const Self as *const [usize; 2]) }
3✔
1391
    }
1392
}
1393

1394
impl AsMut<[usize; 2]> for USizeVec2 {
1395
    #[inline]
1396
    fn as_mut(&mut self) -> &mut [usize; 2] {
3✔
1397
        unsafe { &mut *(self as *mut Self as *mut [usize; 2]) }
3✔
1398
    }
1399
}
1400

1401
impl Sum for USizeVec2 {
1402
    #[inline]
1403
    fn sum<I>(iter: I) -> Self
3✔
1404
    where
1405
        I: Iterator<Item = Self>,
1406
    {
1407
        iter.fold(Self::ZERO, Self::add)
3✔
1408
    }
1409
}
1410

1411
impl<'a> Sum<&'a Self> for USizeVec2 {
1412
    #[inline]
1413
    fn sum<I>(iter: I) -> Self
3✔
1414
    where
1415
        I: Iterator<Item = &'a Self>,
1416
    {
1417
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1418
    }
1419
}
1420

1421
impl Product for USizeVec2 {
1422
    #[inline]
1423
    fn product<I>(iter: I) -> Self
3✔
1424
    where
1425
        I: Iterator<Item = Self>,
1426
    {
1427
        iter.fold(Self::ONE, Self::mul)
3✔
1428
    }
1429
}
1430

1431
impl<'a> Product<&'a Self> for USizeVec2 {
1432
    #[inline]
1433
    fn product<I>(iter: I) -> Self
3✔
1434
    where
1435
        I: Iterator<Item = &'a Self>,
1436
    {
1437
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1438
    }
1439
}
1440

1441
impl Not for USizeVec2 {
1442
    type Output = Self;
1443
    #[inline]
1444
    fn not(self) -> Self {
3✔
1445
        Self {
1446
            x: self.x.not(),
3✔
1447
            y: self.y.not(),
3✔
1448
        }
1449
    }
1450
}
1451

1452
impl Not for &USizeVec2 {
1453
    type Output = USizeVec2;
1454
    #[inline]
1455
    fn not(self) -> USizeVec2 {
3✔
1456
        (*self).not()
3✔
1457
    }
1458
}
1459

1460
impl BitAnd for USizeVec2 {
1461
    type Output = Self;
1462
    #[inline]
1463
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1464
        Self {
1465
            x: self.x.bitand(rhs.x),
3✔
1466
            y: self.y.bitand(rhs.y),
3✔
1467
        }
1468
    }
1469
}
1470

1471
impl BitAnd<&Self> for USizeVec2 {
1472
    type Output = Self;
1473
    #[inline]
1474
    fn bitand(self, rhs: &Self) -> Self {
3✔
1475
        self.bitand(*rhs)
3✔
1476
    }
1477
}
1478

1479
impl BitAnd<&USizeVec2> for &USizeVec2 {
1480
    type Output = USizeVec2;
1481
    #[inline]
1482
    fn bitand(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1483
        (*self).bitand(*rhs)
3✔
1484
    }
1485
}
1486

1487
impl BitAnd<USizeVec2> for &USizeVec2 {
1488
    type Output = USizeVec2;
1489
    #[inline]
1490
    fn bitand(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1491
        (*self).bitand(rhs)
3✔
1492
    }
1493
}
1494

1495
impl BitAndAssign for USizeVec2 {
1496
    #[inline]
1497
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1498
        *self = self.bitand(rhs);
3✔
1499
    }
1500
}
1501

1502
impl BitAndAssign<&Self> for USizeVec2 {
1503
    #[inline]
1504
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1505
        self.bitand_assign(*rhs);
3✔
1506
    }
1507
}
1508

1509
impl BitOr for USizeVec2 {
1510
    type Output = Self;
1511
    #[inline]
1512
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1513
        Self {
1514
            x: self.x.bitor(rhs.x),
3✔
1515
            y: self.y.bitor(rhs.y),
3✔
1516
        }
1517
    }
1518
}
1519

1520
impl BitOr<&Self> for USizeVec2 {
1521
    type Output = Self;
1522
    #[inline]
1523
    fn bitor(self, rhs: &Self) -> Self {
3✔
1524
        self.bitor(*rhs)
3✔
1525
    }
1526
}
1527

1528
impl BitOr<&USizeVec2> for &USizeVec2 {
1529
    type Output = USizeVec2;
1530
    #[inline]
1531
    fn bitor(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1532
        (*self).bitor(*rhs)
3✔
1533
    }
1534
}
1535

1536
impl BitOr<USizeVec2> for &USizeVec2 {
1537
    type Output = USizeVec2;
1538
    #[inline]
1539
    fn bitor(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1540
        (*self).bitor(rhs)
3✔
1541
    }
1542
}
1543

1544
impl BitOrAssign for USizeVec2 {
1545
    #[inline]
1546
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1547
        *self = self.bitor(rhs);
3✔
1548
    }
1549
}
1550

1551
impl BitOrAssign<&Self> for USizeVec2 {
1552
    #[inline]
1553
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1554
        self.bitor_assign(*rhs);
3✔
1555
    }
1556
}
1557

1558
impl BitXor for USizeVec2 {
1559
    type Output = Self;
1560
    #[inline]
1561
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1562
        Self {
1563
            x: self.x.bitxor(rhs.x),
3✔
1564
            y: self.y.bitxor(rhs.y),
3✔
1565
        }
1566
    }
1567
}
1568

1569
impl BitXor<&Self> for USizeVec2 {
1570
    type Output = Self;
1571
    #[inline]
1572
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1573
        self.bitxor(*rhs)
3✔
1574
    }
1575
}
1576

1577
impl BitXor<&USizeVec2> for &USizeVec2 {
1578
    type Output = USizeVec2;
1579
    #[inline]
1580
    fn bitxor(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1581
        (*self).bitxor(*rhs)
3✔
1582
    }
1583
}
1584

1585
impl BitXor<USizeVec2> for &USizeVec2 {
1586
    type Output = USizeVec2;
1587
    #[inline]
1588
    fn bitxor(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1589
        (*self).bitxor(rhs)
3✔
1590
    }
1591
}
1592

1593
impl BitXorAssign for USizeVec2 {
1594
    #[inline]
1595
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1596
        *self = self.bitxor(rhs);
3✔
1597
    }
1598
}
1599

1600
impl BitXorAssign<&Self> for USizeVec2 {
1601
    #[inline]
1602
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1603
        self.bitxor_assign(*rhs);
3✔
1604
    }
1605
}
1606

1607
impl BitAnd<usize> for USizeVec2 {
1608
    type Output = Self;
1609
    #[inline]
1610
    fn bitand(self, rhs: usize) -> Self::Output {
3✔
1611
        Self {
1612
            x: self.x.bitand(rhs),
3✔
1613
            y: self.y.bitand(rhs),
3✔
1614
        }
1615
    }
1616
}
1617

1618
impl BitAnd<&usize> for USizeVec2 {
1619
    type Output = Self;
1620
    #[inline]
1621
    fn bitand(self, rhs: &usize) -> Self {
3✔
1622
        self.bitand(*rhs)
3✔
1623
    }
1624
}
1625

1626
impl BitAnd<&usize> for &USizeVec2 {
1627
    type Output = USizeVec2;
1628
    #[inline]
1629
    fn bitand(self, rhs: &usize) -> USizeVec2 {
3✔
1630
        (*self).bitand(*rhs)
3✔
1631
    }
1632
}
1633

1634
impl BitAnd<usize> for &USizeVec2 {
1635
    type Output = USizeVec2;
1636
    #[inline]
1637
    fn bitand(self, rhs: usize) -> USizeVec2 {
3✔
1638
        (*self).bitand(rhs)
3✔
1639
    }
1640
}
1641

1642
impl BitAndAssign<usize> for USizeVec2 {
1643
    #[inline]
1644
    fn bitand_assign(&mut self, rhs: usize) {
3✔
1645
        *self = self.bitand(rhs);
3✔
1646
    }
1647
}
1648

1649
impl BitAndAssign<&usize> for USizeVec2 {
1650
    #[inline]
1651
    fn bitand_assign(&mut self, rhs: &usize) {
3✔
1652
        self.bitand_assign(*rhs);
3✔
1653
    }
1654
}
1655

1656
impl BitOr<usize> for USizeVec2 {
1657
    type Output = Self;
1658
    #[inline]
1659
    fn bitor(self, rhs: usize) -> Self::Output {
3✔
1660
        Self {
1661
            x: self.x.bitor(rhs),
3✔
1662
            y: self.y.bitor(rhs),
3✔
1663
        }
1664
    }
1665
}
1666

1667
impl BitOr<&usize> for USizeVec2 {
1668
    type Output = Self;
1669
    #[inline]
1670
    fn bitor(self, rhs: &usize) -> Self {
3✔
1671
        self.bitor(*rhs)
3✔
1672
    }
1673
}
1674

1675
impl BitOr<&usize> for &USizeVec2 {
1676
    type Output = USizeVec2;
1677
    #[inline]
1678
    fn bitor(self, rhs: &usize) -> USizeVec2 {
3✔
1679
        (*self).bitor(*rhs)
3✔
1680
    }
1681
}
1682

1683
impl BitOr<usize> for &USizeVec2 {
1684
    type Output = USizeVec2;
1685
    #[inline]
1686
    fn bitor(self, rhs: usize) -> USizeVec2 {
3✔
1687
        (*self).bitor(rhs)
3✔
1688
    }
1689
}
1690

1691
impl BitOrAssign<usize> for USizeVec2 {
1692
    #[inline]
1693
    fn bitor_assign(&mut self, rhs: usize) {
3✔
1694
        *self = self.bitor(rhs);
3✔
1695
    }
1696
}
1697

1698
impl BitOrAssign<&usize> for USizeVec2 {
1699
    #[inline]
1700
    fn bitor_assign(&mut self, rhs: &usize) {
3✔
1701
        self.bitor_assign(*rhs);
3✔
1702
    }
1703
}
1704

1705
impl BitXor<usize> for USizeVec2 {
1706
    type Output = Self;
1707
    #[inline]
1708
    fn bitxor(self, rhs: usize) -> Self::Output {
3✔
1709
        Self {
1710
            x: self.x.bitxor(rhs),
3✔
1711
            y: self.y.bitxor(rhs),
3✔
1712
        }
1713
    }
1714
}
1715

1716
impl BitXor<&usize> for USizeVec2 {
1717
    type Output = Self;
1718
    #[inline]
1719
    fn bitxor(self, rhs: &usize) -> Self {
3✔
1720
        self.bitxor(*rhs)
3✔
1721
    }
1722
}
1723

1724
impl BitXor<&usize> for &USizeVec2 {
1725
    type Output = USizeVec2;
1726
    #[inline]
1727
    fn bitxor(self, rhs: &usize) -> USizeVec2 {
3✔
1728
        (*self).bitxor(*rhs)
3✔
1729
    }
1730
}
1731

1732
impl BitXor<usize> for &USizeVec2 {
1733
    type Output = USizeVec2;
1734
    #[inline]
1735
    fn bitxor(self, rhs: usize) -> USizeVec2 {
3✔
1736
        (*self).bitxor(rhs)
3✔
1737
    }
1738
}
1739

1740
impl BitXorAssign<usize> for USizeVec2 {
1741
    #[inline]
1742
    fn bitxor_assign(&mut self, rhs: usize) {
3✔
1743
        *self = self.bitxor(rhs);
3✔
1744
    }
1745
}
1746

1747
impl BitXorAssign<&usize> for USizeVec2 {
1748
    #[inline]
1749
    fn bitxor_assign(&mut self, rhs: &usize) {
3✔
1750
        self.bitxor_assign(*rhs);
3✔
1751
    }
1752
}
1753

1754
impl Shl<i8> for USizeVec2 {
1755
    type Output = Self;
1756
    #[inline]
1757
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1758
        Self {
1759
            x: self.x.shl(rhs),
3✔
1760
            y: self.y.shl(rhs),
3✔
1761
        }
1762
    }
1763
}
1764

1765
impl Shl<&i8> for USizeVec2 {
1766
    type Output = Self;
1767
    #[inline]
1768
    fn shl(self, rhs: &i8) -> Self {
3✔
1769
        self.shl(*rhs)
3✔
1770
    }
1771
}
1772

1773
impl Shl<&i8> for &USizeVec2 {
1774
    type Output = USizeVec2;
1775
    #[inline]
1776
    fn shl(self, rhs: &i8) -> USizeVec2 {
3✔
1777
        (*self).shl(*rhs)
3✔
1778
    }
1779
}
1780

1781
impl Shl<i8> for &USizeVec2 {
1782
    type Output = USizeVec2;
1783
    #[inline]
1784
    fn shl(self, rhs: i8) -> USizeVec2 {
3✔
1785
        (*self).shl(rhs)
3✔
1786
    }
1787
}
1788

1789
impl ShlAssign<i8> for USizeVec2 {
1790
    #[inline]
1791
    fn shl_assign(&mut self, rhs: i8) {
3✔
1792
        *self = self.shl(rhs);
3✔
1793
    }
1794
}
1795

1796
impl ShlAssign<&i8> for USizeVec2 {
1797
    #[inline]
1798
    fn shl_assign(&mut self, rhs: &i8) {
3✔
1799
        self.shl_assign(*rhs);
3✔
1800
    }
1801
}
1802

1803
impl Shr<i8> for USizeVec2 {
1804
    type Output = Self;
1805
    #[inline]
1806
    fn shr(self, rhs: i8) -> Self::Output {
3✔
1807
        Self {
1808
            x: self.x.shr(rhs),
3✔
1809
            y: self.y.shr(rhs),
3✔
1810
        }
1811
    }
1812
}
1813

1814
impl Shr<&i8> for USizeVec2 {
1815
    type Output = Self;
1816
    #[inline]
1817
    fn shr(self, rhs: &i8) -> Self {
3✔
1818
        self.shr(*rhs)
3✔
1819
    }
1820
}
1821

1822
impl Shr<&i8> for &USizeVec2 {
1823
    type Output = USizeVec2;
1824
    #[inline]
1825
    fn shr(self, rhs: &i8) -> USizeVec2 {
3✔
1826
        (*self).shr(*rhs)
3✔
1827
    }
1828
}
1829

1830
impl Shr<i8> for &USizeVec2 {
1831
    type Output = USizeVec2;
1832
    #[inline]
1833
    fn shr(self, rhs: i8) -> USizeVec2 {
3✔
1834
        (*self).shr(rhs)
3✔
1835
    }
1836
}
1837

1838
impl ShrAssign<i8> for USizeVec2 {
1839
    #[inline]
1840
    fn shr_assign(&mut self, rhs: i8) {
3✔
1841
        *self = self.shr(rhs);
3✔
1842
    }
1843
}
1844

1845
impl ShrAssign<&i8> for USizeVec2 {
1846
    #[inline]
1847
    fn shr_assign(&mut self, rhs: &i8) {
3✔
1848
        self.shr_assign(*rhs);
3✔
1849
    }
1850
}
1851

1852
impl Shl<i16> for USizeVec2 {
1853
    type Output = Self;
1854
    #[inline]
1855
    fn shl(self, rhs: i16) -> Self::Output {
3✔
1856
        Self {
1857
            x: self.x.shl(rhs),
3✔
1858
            y: self.y.shl(rhs),
3✔
1859
        }
1860
    }
1861
}
1862

1863
impl Shl<&i16> for USizeVec2 {
1864
    type Output = Self;
1865
    #[inline]
1866
    fn shl(self, rhs: &i16) -> Self {
3✔
1867
        self.shl(*rhs)
3✔
1868
    }
1869
}
1870

1871
impl Shl<&i16> for &USizeVec2 {
1872
    type Output = USizeVec2;
1873
    #[inline]
1874
    fn shl(self, rhs: &i16) -> USizeVec2 {
3✔
1875
        (*self).shl(*rhs)
3✔
1876
    }
1877
}
1878

1879
impl Shl<i16> for &USizeVec2 {
1880
    type Output = USizeVec2;
1881
    #[inline]
1882
    fn shl(self, rhs: i16) -> USizeVec2 {
3✔
1883
        (*self).shl(rhs)
3✔
1884
    }
1885
}
1886

1887
impl ShlAssign<i16> for USizeVec2 {
1888
    #[inline]
1889
    fn shl_assign(&mut self, rhs: i16) {
3✔
1890
        *self = self.shl(rhs);
3✔
1891
    }
1892
}
1893

1894
impl ShlAssign<&i16> for USizeVec2 {
1895
    #[inline]
1896
    fn shl_assign(&mut self, rhs: &i16) {
3✔
1897
        self.shl_assign(*rhs);
3✔
1898
    }
1899
}
1900

1901
impl Shr<i16> for USizeVec2 {
1902
    type Output = Self;
1903
    #[inline]
1904
    fn shr(self, rhs: i16) -> Self::Output {
3✔
1905
        Self {
1906
            x: self.x.shr(rhs),
3✔
1907
            y: self.y.shr(rhs),
3✔
1908
        }
1909
    }
1910
}
1911

1912
impl Shr<&i16> for USizeVec2 {
1913
    type Output = Self;
1914
    #[inline]
1915
    fn shr(self, rhs: &i16) -> Self {
3✔
1916
        self.shr(*rhs)
3✔
1917
    }
1918
}
1919

1920
impl Shr<&i16> for &USizeVec2 {
1921
    type Output = USizeVec2;
1922
    #[inline]
1923
    fn shr(self, rhs: &i16) -> USizeVec2 {
3✔
1924
        (*self).shr(*rhs)
3✔
1925
    }
1926
}
1927

1928
impl Shr<i16> for &USizeVec2 {
1929
    type Output = USizeVec2;
1930
    #[inline]
1931
    fn shr(self, rhs: i16) -> USizeVec2 {
3✔
1932
        (*self).shr(rhs)
3✔
1933
    }
1934
}
1935

1936
impl ShrAssign<i16> for USizeVec2 {
1937
    #[inline]
1938
    fn shr_assign(&mut self, rhs: i16) {
3✔
1939
        *self = self.shr(rhs);
3✔
1940
    }
1941
}
1942

1943
impl ShrAssign<&i16> for USizeVec2 {
1944
    #[inline]
1945
    fn shr_assign(&mut self, rhs: &i16) {
3✔
1946
        self.shr_assign(*rhs);
3✔
1947
    }
1948
}
1949

1950
impl Shl<i32> for USizeVec2 {
1951
    type Output = Self;
1952
    #[inline]
1953
    fn shl(self, rhs: i32) -> Self::Output {
3✔
1954
        Self {
1955
            x: self.x.shl(rhs),
3✔
1956
            y: self.y.shl(rhs),
3✔
1957
        }
1958
    }
1959
}
1960

1961
impl Shl<&i32> for USizeVec2 {
1962
    type Output = Self;
1963
    #[inline]
1964
    fn shl(self, rhs: &i32) -> Self {
3✔
1965
        self.shl(*rhs)
3✔
1966
    }
1967
}
1968

1969
impl Shl<&i32> for &USizeVec2 {
1970
    type Output = USizeVec2;
1971
    #[inline]
1972
    fn shl(self, rhs: &i32) -> USizeVec2 {
3✔
1973
        (*self).shl(*rhs)
3✔
1974
    }
1975
}
1976

1977
impl Shl<i32> for &USizeVec2 {
1978
    type Output = USizeVec2;
1979
    #[inline]
1980
    fn shl(self, rhs: i32) -> USizeVec2 {
3✔
1981
        (*self).shl(rhs)
3✔
1982
    }
1983
}
1984

1985
impl ShlAssign<i32> for USizeVec2 {
1986
    #[inline]
1987
    fn shl_assign(&mut self, rhs: i32) {
3✔
1988
        *self = self.shl(rhs);
3✔
1989
    }
1990
}
1991

1992
impl ShlAssign<&i32> for USizeVec2 {
1993
    #[inline]
1994
    fn shl_assign(&mut self, rhs: &i32) {
3✔
1995
        self.shl_assign(*rhs);
3✔
1996
    }
1997
}
1998

1999
impl Shr<i32> for USizeVec2 {
2000
    type Output = Self;
2001
    #[inline]
2002
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2003
        Self {
2004
            x: self.x.shr(rhs),
3✔
2005
            y: self.y.shr(rhs),
3✔
2006
        }
2007
    }
2008
}
2009

2010
impl Shr<&i32> for USizeVec2 {
2011
    type Output = Self;
2012
    #[inline]
2013
    fn shr(self, rhs: &i32) -> Self {
3✔
2014
        self.shr(*rhs)
3✔
2015
    }
2016
}
2017

2018
impl Shr<&i32> for &USizeVec2 {
2019
    type Output = USizeVec2;
2020
    #[inline]
2021
    fn shr(self, rhs: &i32) -> USizeVec2 {
3✔
2022
        (*self).shr(*rhs)
3✔
2023
    }
2024
}
2025

2026
impl Shr<i32> for &USizeVec2 {
2027
    type Output = USizeVec2;
2028
    #[inline]
2029
    fn shr(self, rhs: i32) -> USizeVec2 {
3✔
2030
        (*self).shr(rhs)
3✔
2031
    }
2032
}
2033

2034
impl ShrAssign<i32> for USizeVec2 {
2035
    #[inline]
2036
    fn shr_assign(&mut self, rhs: i32) {
3✔
2037
        *self = self.shr(rhs);
3✔
2038
    }
2039
}
2040

2041
impl ShrAssign<&i32> for USizeVec2 {
2042
    #[inline]
2043
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2044
        self.shr_assign(*rhs);
3✔
2045
    }
2046
}
2047

2048
impl Shl<i64> for USizeVec2 {
2049
    type Output = Self;
2050
    #[inline]
2051
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2052
        Self {
2053
            x: self.x.shl(rhs),
3✔
2054
            y: self.y.shl(rhs),
3✔
2055
        }
2056
    }
2057
}
2058

2059
impl Shl<&i64> for USizeVec2 {
2060
    type Output = Self;
2061
    #[inline]
2062
    fn shl(self, rhs: &i64) -> Self {
3✔
2063
        self.shl(*rhs)
3✔
2064
    }
2065
}
2066

2067
impl Shl<&i64> for &USizeVec2 {
2068
    type Output = USizeVec2;
2069
    #[inline]
2070
    fn shl(self, rhs: &i64) -> USizeVec2 {
3✔
2071
        (*self).shl(*rhs)
3✔
2072
    }
2073
}
2074

2075
impl Shl<i64> for &USizeVec2 {
2076
    type Output = USizeVec2;
2077
    #[inline]
2078
    fn shl(self, rhs: i64) -> USizeVec2 {
3✔
2079
        (*self).shl(rhs)
3✔
2080
    }
2081
}
2082

2083
impl ShlAssign<i64> for USizeVec2 {
2084
    #[inline]
2085
    fn shl_assign(&mut self, rhs: i64) {
3✔
2086
        *self = self.shl(rhs);
3✔
2087
    }
2088
}
2089

2090
impl ShlAssign<&i64> for USizeVec2 {
2091
    #[inline]
2092
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2093
        self.shl_assign(*rhs);
3✔
2094
    }
2095
}
2096

2097
impl Shr<i64> for USizeVec2 {
2098
    type Output = Self;
2099
    #[inline]
2100
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2101
        Self {
2102
            x: self.x.shr(rhs),
3✔
2103
            y: self.y.shr(rhs),
3✔
2104
        }
2105
    }
2106
}
2107

2108
impl Shr<&i64> for USizeVec2 {
2109
    type Output = Self;
2110
    #[inline]
2111
    fn shr(self, rhs: &i64) -> Self {
3✔
2112
        self.shr(*rhs)
3✔
2113
    }
2114
}
2115

2116
impl Shr<&i64> for &USizeVec2 {
2117
    type Output = USizeVec2;
2118
    #[inline]
2119
    fn shr(self, rhs: &i64) -> USizeVec2 {
3✔
2120
        (*self).shr(*rhs)
3✔
2121
    }
2122
}
2123

2124
impl Shr<i64> for &USizeVec2 {
2125
    type Output = USizeVec2;
2126
    #[inline]
2127
    fn shr(self, rhs: i64) -> USizeVec2 {
3✔
2128
        (*self).shr(rhs)
3✔
2129
    }
2130
}
2131

2132
impl ShrAssign<i64> for USizeVec2 {
2133
    #[inline]
2134
    fn shr_assign(&mut self, rhs: i64) {
3✔
2135
        *self = self.shr(rhs);
3✔
2136
    }
2137
}
2138

2139
impl ShrAssign<&i64> for USizeVec2 {
2140
    #[inline]
2141
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2142
        self.shr_assign(*rhs);
3✔
2143
    }
2144
}
2145

2146
impl Shl<u8> for USizeVec2 {
2147
    type Output = Self;
2148
    #[inline]
2149
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2150
        Self {
2151
            x: self.x.shl(rhs),
3✔
2152
            y: self.y.shl(rhs),
3✔
2153
        }
2154
    }
2155
}
2156

2157
impl Shl<&u8> for USizeVec2 {
2158
    type Output = Self;
2159
    #[inline]
2160
    fn shl(self, rhs: &u8) -> Self {
3✔
2161
        self.shl(*rhs)
3✔
2162
    }
2163
}
2164

2165
impl Shl<&u8> for &USizeVec2 {
2166
    type Output = USizeVec2;
2167
    #[inline]
2168
    fn shl(self, rhs: &u8) -> USizeVec2 {
3✔
2169
        (*self).shl(*rhs)
3✔
2170
    }
2171
}
2172

2173
impl Shl<u8> for &USizeVec2 {
2174
    type Output = USizeVec2;
2175
    #[inline]
2176
    fn shl(self, rhs: u8) -> USizeVec2 {
3✔
2177
        (*self).shl(rhs)
3✔
2178
    }
2179
}
2180

2181
impl ShlAssign<u8> for USizeVec2 {
2182
    #[inline]
2183
    fn shl_assign(&mut self, rhs: u8) {
3✔
2184
        *self = self.shl(rhs);
3✔
2185
    }
2186
}
2187

2188
impl ShlAssign<&u8> for USizeVec2 {
2189
    #[inline]
2190
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2191
        self.shl_assign(*rhs);
3✔
2192
    }
2193
}
2194

2195
impl Shr<u8> for USizeVec2 {
2196
    type Output = Self;
2197
    #[inline]
2198
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2199
        Self {
2200
            x: self.x.shr(rhs),
3✔
2201
            y: self.y.shr(rhs),
3✔
2202
        }
2203
    }
2204
}
2205

2206
impl Shr<&u8> for USizeVec2 {
2207
    type Output = Self;
2208
    #[inline]
2209
    fn shr(self, rhs: &u8) -> Self {
3✔
2210
        self.shr(*rhs)
3✔
2211
    }
2212
}
2213

2214
impl Shr<&u8> for &USizeVec2 {
2215
    type Output = USizeVec2;
2216
    #[inline]
2217
    fn shr(self, rhs: &u8) -> USizeVec2 {
3✔
2218
        (*self).shr(*rhs)
3✔
2219
    }
2220
}
2221

2222
impl Shr<u8> for &USizeVec2 {
2223
    type Output = USizeVec2;
2224
    #[inline]
2225
    fn shr(self, rhs: u8) -> USizeVec2 {
3✔
2226
        (*self).shr(rhs)
3✔
2227
    }
2228
}
2229

2230
impl ShrAssign<u8> for USizeVec2 {
2231
    #[inline]
2232
    fn shr_assign(&mut self, rhs: u8) {
3✔
2233
        *self = self.shr(rhs);
3✔
2234
    }
2235
}
2236

2237
impl ShrAssign<&u8> for USizeVec2 {
2238
    #[inline]
2239
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2240
        self.shr_assign(*rhs);
3✔
2241
    }
2242
}
2243

2244
impl Shl<u16> for USizeVec2 {
2245
    type Output = Self;
2246
    #[inline]
2247
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2248
        Self {
2249
            x: self.x.shl(rhs),
3✔
2250
            y: self.y.shl(rhs),
3✔
2251
        }
2252
    }
2253
}
2254

2255
impl Shl<&u16> for USizeVec2 {
2256
    type Output = Self;
2257
    #[inline]
2258
    fn shl(self, rhs: &u16) -> Self {
3✔
2259
        self.shl(*rhs)
3✔
2260
    }
2261
}
2262

2263
impl Shl<&u16> for &USizeVec2 {
2264
    type Output = USizeVec2;
2265
    #[inline]
2266
    fn shl(self, rhs: &u16) -> USizeVec2 {
3✔
2267
        (*self).shl(*rhs)
3✔
2268
    }
2269
}
2270

2271
impl Shl<u16> for &USizeVec2 {
2272
    type Output = USizeVec2;
2273
    #[inline]
2274
    fn shl(self, rhs: u16) -> USizeVec2 {
3✔
2275
        (*self).shl(rhs)
3✔
2276
    }
2277
}
2278

2279
impl ShlAssign<u16> for USizeVec2 {
2280
    #[inline]
2281
    fn shl_assign(&mut self, rhs: u16) {
3✔
2282
        *self = self.shl(rhs);
3✔
2283
    }
2284
}
2285

2286
impl ShlAssign<&u16> for USizeVec2 {
2287
    #[inline]
2288
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2289
        self.shl_assign(*rhs);
3✔
2290
    }
2291
}
2292

2293
impl Shr<u16> for USizeVec2 {
2294
    type Output = Self;
2295
    #[inline]
2296
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2297
        Self {
2298
            x: self.x.shr(rhs),
3✔
2299
            y: self.y.shr(rhs),
3✔
2300
        }
2301
    }
2302
}
2303

2304
impl Shr<&u16> for USizeVec2 {
2305
    type Output = Self;
2306
    #[inline]
2307
    fn shr(self, rhs: &u16) -> Self {
3✔
2308
        self.shr(*rhs)
3✔
2309
    }
2310
}
2311

2312
impl Shr<&u16> for &USizeVec2 {
2313
    type Output = USizeVec2;
2314
    #[inline]
2315
    fn shr(self, rhs: &u16) -> USizeVec2 {
3✔
2316
        (*self).shr(*rhs)
3✔
2317
    }
2318
}
2319

2320
impl Shr<u16> for &USizeVec2 {
2321
    type Output = USizeVec2;
2322
    #[inline]
2323
    fn shr(self, rhs: u16) -> USizeVec2 {
3✔
2324
        (*self).shr(rhs)
3✔
2325
    }
2326
}
2327

2328
impl ShrAssign<u16> for USizeVec2 {
2329
    #[inline]
2330
    fn shr_assign(&mut self, rhs: u16) {
3✔
2331
        *self = self.shr(rhs);
3✔
2332
    }
2333
}
2334

2335
impl ShrAssign<&u16> for USizeVec2 {
2336
    #[inline]
2337
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2338
        self.shr_assign(*rhs);
3✔
2339
    }
2340
}
2341

2342
impl Shl<u32> for USizeVec2 {
2343
    type Output = Self;
2344
    #[inline]
2345
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2346
        Self {
2347
            x: self.x.shl(rhs),
3✔
2348
            y: self.y.shl(rhs),
3✔
2349
        }
2350
    }
2351
}
2352

2353
impl Shl<&u32> for USizeVec2 {
2354
    type Output = Self;
2355
    #[inline]
2356
    fn shl(self, rhs: &u32) -> Self {
3✔
2357
        self.shl(*rhs)
3✔
2358
    }
2359
}
2360

2361
impl Shl<&u32> for &USizeVec2 {
2362
    type Output = USizeVec2;
2363
    #[inline]
2364
    fn shl(self, rhs: &u32) -> USizeVec2 {
3✔
2365
        (*self).shl(*rhs)
3✔
2366
    }
2367
}
2368

2369
impl Shl<u32> for &USizeVec2 {
2370
    type Output = USizeVec2;
2371
    #[inline]
2372
    fn shl(self, rhs: u32) -> USizeVec2 {
3✔
2373
        (*self).shl(rhs)
3✔
2374
    }
2375
}
2376

2377
impl ShlAssign<u32> for USizeVec2 {
2378
    #[inline]
2379
    fn shl_assign(&mut self, rhs: u32) {
3✔
2380
        *self = self.shl(rhs);
3✔
2381
    }
2382
}
2383

2384
impl ShlAssign<&u32> for USizeVec2 {
2385
    #[inline]
2386
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2387
        self.shl_assign(*rhs);
3✔
2388
    }
2389
}
2390

2391
impl Shr<u32> for USizeVec2 {
2392
    type Output = Self;
2393
    #[inline]
2394
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2395
        Self {
2396
            x: self.x.shr(rhs),
3✔
2397
            y: self.y.shr(rhs),
3✔
2398
        }
2399
    }
2400
}
2401

2402
impl Shr<&u32> for USizeVec2 {
2403
    type Output = Self;
2404
    #[inline]
2405
    fn shr(self, rhs: &u32) -> Self {
3✔
2406
        self.shr(*rhs)
3✔
2407
    }
2408
}
2409

2410
impl Shr<&u32> for &USizeVec2 {
2411
    type Output = USizeVec2;
2412
    #[inline]
2413
    fn shr(self, rhs: &u32) -> USizeVec2 {
3✔
2414
        (*self).shr(*rhs)
3✔
2415
    }
2416
}
2417

2418
impl Shr<u32> for &USizeVec2 {
2419
    type Output = USizeVec2;
2420
    #[inline]
2421
    fn shr(self, rhs: u32) -> USizeVec2 {
3✔
2422
        (*self).shr(rhs)
3✔
2423
    }
2424
}
2425

2426
impl ShrAssign<u32> for USizeVec2 {
2427
    #[inline]
2428
    fn shr_assign(&mut self, rhs: u32) {
3✔
2429
        *self = self.shr(rhs);
3✔
2430
    }
2431
}
2432

2433
impl ShrAssign<&u32> for USizeVec2 {
2434
    #[inline]
2435
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2436
        self.shr_assign(*rhs);
3✔
2437
    }
2438
}
2439

2440
impl Shl<u64> for USizeVec2 {
2441
    type Output = Self;
2442
    #[inline]
2443
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2444
        Self {
2445
            x: self.x.shl(rhs),
3✔
2446
            y: self.y.shl(rhs),
3✔
2447
        }
2448
    }
2449
}
2450

2451
impl Shl<&u64> for USizeVec2 {
2452
    type Output = Self;
2453
    #[inline]
2454
    fn shl(self, rhs: &u64) -> Self {
3✔
2455
        self.shl(*rhs)
3✔
2456
    }
2457
}
2458

2459
impl Shl<&u64> for &USizeVec2 {
2460
    type Output = USizeVec2;
2461
    #[inline]
2462
    fn shl(self, rhs: &u64) -> USizeVec2 {
3✔
2463
        (*self).shl(*rhs)
3✔
2464
    }
2465
}
2466

2467
impl Shl<u64> for &USizeVec2 {
2468
    type Output = USizeVec2;
2469
    #[inline]
2470
    fn shl(self, rhs: u64) -> USizeVec2 {
3✔
2471
        (*self).shl(rhs)
3✔
2472
    }
2473
}
2474

2475
impl ShlAssign<u64> for USizeVec2 {
2476
    #[inline]
2477
    fn shl_assign(&mut self, rhs: u64) {
3✔
2478
        *self = self.shl(rhs);
3✔
2479
    }
2480
}
2481

2482
impl ShlAssign<&u64> for USizeVec2 {
2483
    #[inline]
2484
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2485
        self.shl_assign(*rhs);
3✔
2486
    }
2487
}
2488

2489
impl Shr<u64> for USizeVec2 {
2490
    type Output = Self;
2491
    #[inline]
2492
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2493
        Self {
2494
            x: self.x.shr(rhs),
3✔
2495
            y: self.y.shr(rhs),
3✔
2496
        }
2497
    }
2498
}
2499

2500
impl Shr<&u64> for USizeVec2 {
2501
    type Output = Self;
2502
    #[inline]
2503
    fn shr(self, rhs: &u64) -> Self {
3✔
2504
        self.shr(*rhs)
3✔
2505
    }
2506
}
2507

2508
impl Shr<&u64> for &USizeVec2 {
2509
    type Output = USizeVec2;
2510
    #[inline]
2511
    fn shr(self, rhs: &u64) -> USizeVec2 {
3✔
2512
        (*self).shr(*rhs)
3✔
2513
    }
2514
}
2515

2516
impl Shr<u64> for &USizeVec2 {
2517
    type Output = USizeVec2;
2518
    #[inline]
2519
    fn shr(self, rhs: u64) -> USizeVec2 {
3✔
2520
        (*self).shr(rhs)
3✔
2521
    }
2522
}
2523

2524
impl ShrAssign<u64> for USizeVec2 {
2525
    #[inline]
2526
    fn shr_assign(&mut self, rhs: u64) {
3✔
2527
        *self = self.shr(rhs);
3✔
2528
    }
2529
}
2530

2531
impl ShrAssign<&u64> for USizeVec2 {
2532
    #[inline]
2533
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2534
        self.shr_assign(*rhs);
3✔
2535
    }
2536
}
2537

2538
#[cfg(feature = "i32")]
2539

2540
impl Shl<IVec2> for USizeVec2 {
2541
    type Output = Self;
2542
    #[inline]
2543
    fn shl(self, rhs: IVec2) -> Self {
3✔
2544
        Self {
2545
            x: self.x.shl(rhs.x),
3✔
2546
            y: self.y.shl(rhs.y),
3✔
2547
        }
2548
    }
2549
}
2550

2551
#[cfg(feature = "i32")]
2552

2553
impl Shl<&IVec2> for USizeVec2 {
2554
    type Output = Self;
2555
    #[inline]
2556
    fn shl(self, rhs: &IVec2) -> Self {
3✔
2557
        self.shl(*rhs)
3✔
2558
    }
2559
}
2560

2561
#[cfg(feature = "i32")]
2562

2563
impl Shl<&IVec2> for &USizeVec2 {
2564
    type Output = USizeVec2;
2565
    #[inline]
2566
    fn shl(self, rhs: &IVec2) -> USizeVec2 {
3✔
2567
        (*self).shl(*rhs)
3✔
2568
    }
2569
}
2570

2571
#[cfg(feature = "i32")]
2572

2573
impl Shl<IVec2> for &USizeVec2 {
2574
    type Output = USizeVec2;
2575
    #[inline]
2576
    fn shl(self, rhs: IVec2) -> USizeVec2 {
3✔
2577
        (*self).shl(rhs)
3✔
2578
    }
2579
}
2580

2581
#[cfg(feature = "i32")]
2582

2583
impl Shr<IVec2> for USizeVec2 {
2584
    type Output = Self;
2585
    #[inline]
2586
    fn shr(self, rhs: IVec2) -> Self {
3✔
2587
        Self {
2588
            x: self.x.shr(rhs.x),
3✔
2589
            y: self.y.shr(rhs.y),
3✔
2590
        }
2591
    }
2592
}
2593

2594
#[cfg(feature = "i32")]
2595

2596
impl Shr<&IVec2> for USizeVec2 {
2597
    type Output = Self;
2598
    #[inline]
2599
    fn shr(self, rhs: &IVec2) -> Self {
3✔
2600
        self.shr(*rhs)
3✔
2601
    }
2602
}
2603

2604
#[cfg(feature = "i32")]
2605

2606
impl Shr<&IVec2> for &USizeVec2 {
2607
    type Output = USizeVec2;
2608
    #[inline]
2609
    fn shr(self, rhs: &IVec2) -> USizeVec2 {
3✔
2610
        (*self).shr(*rhs)
3✔
2611
    }
2612
}
2613

2614
#[cfg(feature = "i32")]
2615

2616
impl Shr<IVec2> for &USizeVec2 {
2617
    type Output = USizeVec2;
2618
    #[inline]
2619
    fn shr(self, rhs: IVec2) -> USizeVec2 {
3✔
2620
        (*self).shr(rhs)
3✔
2621
    }
2622
}
2623

2624
#[cfg(feature = "u32")]
2625

2626
impl Shl<UVec2> for USizeVec2 {
2627
    type Output = Self;
2628
    #[inline]
2629
    fn shl(self, rhs: UVec2) -> Self {
3✔
2630
        Self {
2631
            x: self.x.shl(rhs.x),
3✔
2632
            y: self.y.shl(rhs.y),
3✔
2633
        }
2634
    }
2635
}
2636

2637
#[cfg(feature = "u32")]
2638

2639
impl Shl<&UVec2> for USizeVec2 {
2640
    type Output = Self;
2641
    #[inline]
2642
    fn shl(self, rhs: &UVec2) -> Self {
3✔
2643
        self.shl(*rhs)
3✔
2644
    }
2645
}
2646

2647
#[cfg(feature = "u32")]
2648

2649
impl Shl<&UVec2> for &USizeVec2 {
2650
    type Output = USizeVec2;
2651
    #[inline]
2652
    fn shl(self, rhs: &UVec2) -> USizeVec2 {
3✔
2653
        (*self).shl(*rhs)
3✔
2654
    }
2655
}
2656

2657
#[cfg(feature = "u32")]
2658

2659
impl Shl<UVec2> for &USizeVec2 {
2660
    type Output = USizeVec2;
2661
    #[inline]
2662
    fn shl(self, rhs: UVec2) -> USizeVec2 {
3✔
2663
        (*self).shl(rhs)
3✔
2664
    }
2665
}
2666

2667
#[cfg(feature = "u32")]
2668

2669
impl Shr<UVec2> for USizeVec2 {
2670
    type Output = Self;
2671
    #[inline]
2672
    fn shr(self, rhs: UVec2) -> Self {
3✔
2673
        Self {
2674
            x: self.x.shr(rhs.x),
3✔
2675
            y: self.y.shr(rhs.y),
3✔
2676
        }
2677
    }
2678
}
2679

2680
#[cfg(feature = "u32")]
2681

2682
impl Shr<&UVec2> for USizeVec2 {
2683
    type Output = Self;
2684
    #[inline]
2685
    fn shr(self, rhs: &UVec2) -> Self {
3✔
2686
        self.shr(*rhs)
3✔
2687
    }
2688
}
2689

2690
#[cfg(feature = "u32")]
2691

2692
impl Shr<&UVec2> for &USizeVec2 {
2693
    type Output = USizeVec2;
2694
    #[inline]
2695
    fn shr(self, rhs: &UVec2) -> USizeVec2 {
3✔
2696
        (*self).shr(*rhs)
3✔
2697
    }
2698
}
2699

2700
#[cfg(feature = "u32")]
2701

2702
impl Shr<UVec2> for &USizeVec2 {
2703
    type Output = USizeVec2;
2704
    #[inline]
2705
    fn shr(self, rhs: UVec2) -> USizeVec2 {
3✔
2706
        (*self).shr(rhs)
3✔
2707
    }
2708
}
2709

2710
impl Index<usize> for USizeVec2 {
2711
    type Output = usize;
2712
    #[inline]
2713
    fn index(&self, index: usize) -> &Self::Output {
3✔
2714
        match index {
6✔
2715
            0 => &self.x,
3✔
2716
            1 => &self.y,
3✔
2717
            _ => panic!("index out of bounds"),
×
2718
        }
2719
    }
2720
}
2721

2722
impl IndexMut<usize> for USizeVec2 {
2723
    #[inline]
2724
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2725
        match index {
6✔
2726
            0 => &mut self.x,
3✔
2727
            1 => &mut self.y,
3✔
2728
            _ => panic!("index out of bounds"),
×
2729
        }
2730
    }
2731
}
2732

2733
impl fmt::Display for USizeVec2 {
2734
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2735
        write!(f, "[{}, {}]", self.x, self.y)
3✔
2736
    }
2737
}
2738

2739
impl fmt::Debug for USizeVec2 {
2740
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2741
        fmt.debug_tuple(stringify!(USizeVec2))
3✔
2742
            .field(&self.x)
3✔
2743
            .field(&self.y)
3✔
2744
            .finish()
2745
    }
2746
}
2747

2748
impl From<[usize; 2]> for USizeVec2 {
2749
    #[inline]
2750
    fn from(a: [usize; 2]) -> Self {
×
2751
        Self::new(a[0], a[1])
3✔
2752
    }
2753
}
2754

2755
impl From<USizeVec2> for [usize; 2] {
2756
    #[inline]
2757
    fn from(v: USizeVec2) -> Self {
3✔
2758
        [v.x, v.y]
3✔
2759
    }
2760
}
2761

2762
impl From<(usize, usize)> for USizeVec2 {
2763
    #[inline]
2764
    fn from(t: (usize, usize)) -> Self {
3✔
2765
        Self::new(t.0, t.1)
×
2766
    }
2767
}
2768

2769
impl From<USizeVec2> for (usize, usize) {
2770
    #[inline]
2771
    fn from(v: USizeVec2) -> Self {
3✔
2772
        (v.x, v.y)
×
2773
    }
2774
}
2775

2776
impl From<U8Vec2> for USizeVec2 {
2777
    #[inline]
2778
    fn from(v: U8Vec2) -> Self {
3✔
2779
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2780
    }
2781
}
2782

2783
impl From<U16Vec2> for USizeVec2 {
2784
    #[inline]
2785
    fn from(v: U16Vec2) -> Self {
3✔
2786
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2787
    }
2788
}
2789

2790
#[cfg(feature = "i8")]
2791

2792
impl TryFrom<I8Vec2> for USizeVec2 {
2793
    type Error = core::num::TryFromIntError;
2794

2795
    #[inline]
2796
    fn try_from(v: I8Vec2) -> Result<Self, Self::Error> {
3✔
2797
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2798
    }
2799
}
2800

2801
#[cfg(feature = "i16")]
2802

2803
impl TryFrom<I16Vec2> for USizeVec2 {
2804
    type Error = core::num::TryFromIntError;
2805

2806
    #[inline]
2807
    fn try_from(v: I16Vec2) -> Result<Self, Self::Error> {
3✔
2808
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2809
    }
2810
}
2811

2812
#[cfg(feature = "i32")]
2813

2814
impl TryFrom<IVec2> for USizeVec2 {
2815
    type Error = core::num::TryFromIntError;
2816

2817
    #[inline]
2818
    fn try_from(v: IVec2) -> Result<Self, Self::Error> {
3✔
2819
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2820
    }
2821
}
2822

2823
#[cfg(feature = "i64")]
2824

2825
impl TryFrom<I64Vec2> for USizeVec2 {
2826
    type Error = core::num::TryFromIntError;
2827

2828
    #[inline]
2829
    fn try_from(v: I64Vec2) -> Result<Self, Self::Error> {
3✔
2830
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2831
    }
2832
}
2833

2834
#[cfg(feature = "u32")]
2835

2836
impl TryFrom<UVec2> for USizeVec2 {
2837
    type Error = core::num::TryFromIntError;
2838

2839
    #[inline]
2840
    fn try_from(v: UVec2) -> Result<Self, Self::Error> {
3✔
2841
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2842
    }
2843
}
2844

2845
#[cfg(feature = "u64")]
2846

2847
impl TryFrom<U64Vec2> for USizeVec2 {
2848
    type Error = core::num::TryFromIntError;
2849

2850
    #[inline]
2851
    fn try_from(v: U64Vec2) -> Result<Self, Self::Error> {
3✔
2852
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2853
    }
2854
}
2855

2856
#[cfg(feature = "isize")]
2857

2858
impl TryFrom<ISizeVec2> for USizeVec2 {
2859
    type Error = core::num::TryFromIntError;
2860

2861
    #[inline]
2862
    fn try_from(v: ISizeVec2) -> Result<Self, Self::Error> {
3✔
2863
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2864
    }
2865
}
2866

2867
impl From<BVec2> for USizeVec2 {
2868
    #[inline]
2869
    fn from(v: BVec2) -> Self {
3✔
2870
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2871
    }
2872
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc