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

bitshifter / glam-rs / 30790923686

03 Aug 2026 06:39AM UTC coverage: 99.121% (-0.008%) from 99.129%
30790923686

push

github

web-flow
Tidy up issue templates. (#763)

95286 of 96131 relevant lines covered (99.12%)

119629.9 hits per line

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

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

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

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

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

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

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

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

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

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

26
#[cfg(feature = "u64")]
27
use crate::U64Vec2;
28

29
#[cfg(feature = "isize")]
30
use crate::ISizeVec2;
31

32
use core::fmt;
33
use core::iter::{Product, Sum};
34
use core::{f32, ops::*};
35

36
#[cfg(feature = "zerocopy")]
37
use zerocopy_derive::*;
38

39
/// Creates a 2-dimensional vector.
40
#[inline(always)]
41
#[must_use]
42
pub const fn usizevec2(x: usize, y: usize) -> USizeVec2 {
206✔
43
    USizeVec2::new(x, y)
206✔
44
}
206✔
45

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

61
impl USizeVec2 {
62
    /// All zeroes.
63
    pub const ZERO: Self = Self::splat(0);
64

65
    /// All ones.
66
    pub const ONE: Self = Self::splat(1);
67

68
    /// All `usize::MIN`.
69
    pub const MIN: Self = Self::splat(usize::MIN);
70

71
    /// All `usize::MAX`.
72
    pub const MAX: Self = Self::splat(usize::MAX);
73

74
    /// A unit vector pointing along the positive X axis.
75
    pub const X: Self = Self::new(1, 0);
76

77
    /// A unit vector pointing along the positive Y axis.
78
    pub const Y: Self = Self::new(0, 1);
79

80
    /// The unit axes.
81
    pub const AXES: [Self; 2] = [Self::X, Self::Y];
82

83
    /// Creates a new vector.
84
    #[inline(always)]
85
    #[must_use]
86
    pub const fn new(x: usize, y: usize) -> Self {
5,740✔
87
        Self { x, y }
5,740✔
88
    }
5,740✔
89

90
    /// Creates a vector with all elements set to `v`.
91
    #[inline]
92
    #[must_use]
93
    pub const fn splat(v: usize) -> Self {
12✔
94
        Self { x: v, y: v }
12✔
95
    }
12✔
96

97
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
98
    #[inline]
99
    #[must_use]
100
    pub fn map<F>(self, mut f: F) -> Self
8✔
101
    where
8✔
102
        F: FnMut(usize) -> usize,
8✔
103
    {
104
        Self::new(f(self.x), f(self.y))
8✔
105
    }
8✔
106

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

121
    /// Creates a new vector from an array.
122
    #[inline]
123
    #[must_use]
124
    pub const fn from_array(a: [usize; 2]) -> Self {
4✔
125
        Self::new(a[0], a[1])
4✔
126
    }
4✔
127

128
    /// Converts `self` to `[x, y]`
129
    #[inline]
130
    #[must_use]
131
    pub const fn to_array(&self) -> [usize; 2] {
16✔
132
        [self.x, self.y]
16✔
133
    }
16✔
134

135
    /// Creates a vector from the first 2 values in `slice`.
136
    ///
137
    /// # Panics
138
    ///
139
    /// Panics if `slice` is less than 2 elements long.
140
    #[inline]
141
    #[must_use]
142
    pub const fn from_slice(slice: &[usize]) -> Self {
12✔
143
        assert!(slice.len() >= 2);
12✔
144
        Self::new(slice[0], slice[1])
8✔
145
    }
8✔
146

147
    /// Writes the elements of `self` to the first 2 elements in `slice`.
148
    ///
149
    /// # Panics
150
    ///
151
    /// Panics if `slice` is less than 2 elements long.
152
    #[inline]
153
    pub fn write_to_slice(self, slice: &mut [usize]) {
12✔
154
        slice[..2].copy_from_slice(&self.to_array());
12✔
155
    }
12✔
156

157
    /// Creates a 3D vector from `self` and the given `z` value.
158
    #[inline]
159
    #[must_use]
160
    pub const fn extend(self, z: usize) -> USizeVec3 {
4✔
161
        USizeVec3::new(self.x, self.y, z)
4✔
162
    }
4✔
163

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

172
    /// Creates a 2D vector from `self` with the given value of `y`.
173
    #[inline]
174
    #[must_use]
175
    pub fn with_y(mut self, y: usize) -> Self {
4✔
176
        self.y = y;
4✔
177
        self
4✔
178
    }
4✔
179

180
    /// Computes the dot product of `self` and `rhs`.
181
    #[inline]
182
    #[must_use]
183
    pub fn dot(self, rhs: Self) -> usize {
20✔
184
        (self.x * rhs.x) + (self.y * rhs.y)
20✔
185
    }
20✔
186

187
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
188
    #[inline]
189
    #[must_use]
190
    pub fn dot_into_vec(self, rhs: Self) -> Self {
4✔
191
        Self::splat(self.dot(rhs))
4✔
192
    }
4✔
193

194
    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
195
    ///
196
    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
197
    #[inline]
198
    #[must_use]
199
    pub fn min(self, rhs: Self) -> Self {
32✔
200
        Self {
201
            x: if self.x < rhs.x { self.x } else { rhs.x },
32✔
202
            y: if self.y < rhs.y { self.y } else { rhs.y },
32✔
203
        }
204
    }
32✔
205

206
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
207
    ///
208
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
209
    #[inline]
210
    #[must_use]
211
    pub fn max(self, rhs: Self) -> Self {
32✔
212
        Self {
213
            x: if self.x > rhs.x { self.x } else { rhs.x },
32✔
214
            y: if self.y > rhs.y { self.y } else { rhs.y },
32✔
215
        }
216
    }
32✔
217

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

232
    /// Returns the horizontal minimum of `self`.
233
    ///
234
    /// In other words this computes `min(x, y, ..)`.
235
    #[inline]
236
    #[must_use]
237
    pub fn min_element(self) -> usize {
8✔
238
        let min = |a, b| if a < b { a } else { b };
8✔
239
        min(self.x, self.y)
8✔
240
    }
8✔
241

242
    /// Returns the horizontal maximum of `self`.
243
    ///
244
    /// In other words this computes `max(x, y, ..)`.
245
    #[inline]
246
    #[must_use]
247
    pub fn max_element(self) -> usize {
8✔
248
        let max = |a, b| if a > b { a } else { b };
8✔
249
        max(self.x, self.y)
8✔
250
    }
8✔
251

252
    /// Returns the index of the first minimum element of `self`.
253
    #[doc(alias = "argmin")]
254
    #[inline]
255
    #[must_use]
256
    pub fn min_position(self) -> usize {
12✔
257
        if self.x <= self.y {
12✔
258
            0
8✔
259
        } else {
260
            1
4✔
261
        }
262
    }
12✔
263

264
    /// Returns the index of the first maximum element of `self`.
265
    #[doc(alias = "argmax")]
266
    #[inline]
267
    #[must_use]
268
    pub fn max_position(self) -> usize {
12✔
269
        if self.x >= self.y {
12✔
270
            0
8✔
271
        } else {
272
            1
4✔
273
        }
274
    }
12✔
275

276
    /// Returns the sum of all elements of `self`.
277
    ///
278
    /// In other words, this computes `self.x + self.y + ..`.
279
    #[inline]
280
    #[must_use]
281
    pub fn element_sum(self) -> usize {
4✔
282
        self.x + self.y
4✔
283
    }
4✔
284

285
    /// Returns the product of all elements of `self`.
286
    ///
287
    /// In other words, this computes `self.x * self.y * ..`.
288
    #[inline]
289
    #[must_use]
290
    pub fn element_product(self) -> usize {
4✔
291
        self.x * self.y
4✔
292
    }
4✔
293

294
    /// Returns a vector mask containing the result of a `==` comparison for each element of
295
    /// `self` and `rhs`.
296
    ///
297
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
298
    /// elements.
299
    #[inline]
300
    #[must_use]
301
    pub fn cmpeq(self, rhs: Self) -> BVec2 {
12✔
302
        BVec2::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y))
12✔
303
    }
12✔
304

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

316
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
317
    /// `self` and `rhs`.
318
    ///
319
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
320
    /// elements.
321
    #[inline]
322
    #[must_use]
323
    pub fn cmpge(self, rhs: Self) -> BVec2 {
16✔
324
        BVec2::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y))
16✔
325
    }
16✔
326

327
    /// Returns a vector mask containing the result of a `>` comparison for each element of
328
    /// `self` and `rhs`.
329
    ///
330
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
331
    /// elements.
332
    #[inline]
333
    #[must_use]
334
    pub fn cmpgt(self, rhs: Self) -> BVec2 {
4✔
335
        BVec2::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y))
4✔
336
    }
4✔
337

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

349
    /// Returns a vector mask containing the result of a `<` comparison for each element of
350
    /// `self` and `rhs`.
351
    ///
352
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
353
    /// elements.
354
    #[inline]
355
    #[must_use]
356
    pub fn cmplt(self, rhs: Self) -> BVec2 {
20✔
357
        BVec2::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y))
20✔
358
    }
20✔
359

360
    /// Computes the squared length of `self`.
361
    #[doc(alias = "magnitude2")]
362
    #[inline]
363
    #[must_use]
364
    pub fn length_squared(self) -> usize {
8✔
365
        self.dot(self)
8✔
366
    }
8✔
367

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

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

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

407
    /// Casts all elements of `self` to `f32`.
408
    #[inline]
409
    #[must_use]
410
    pub fn as_vec2(self) -> crate::Vec2 {
4✔
411
        crate::Vec2::new(self.x as f32, self.y as f32)
4✔
412
    }
4✔
413

414
    /// Casts all elements of `self` to `f64`.
415
    #[cfg(feature = "f64")]
416
    #[inline]
417
    #[must_use]
418
    pub fn as_dvec2(self) -> crate::DVec2 {
4✔
419
        crate::DVec2::new(self.x as f64, self.y as f64)
4✔
420
    }
4✔
421

422
    /// Casts all elements of `self` to `i8`.
423
    #[cfg(feature = "i8")]
424
    #[inline]
425
    #[must_use]
426
    pub fn as_i8vec2(self) -> crate::I8Vec2 {
4✔
427
        crate::I8Vec2::new(self.x as i8, self.y as i8)
4✔
428
    }
4✔
429

430
    /// Casts all elements of `self` to `u8`.
431
    #[cfg(feature = "u8")]
432
    #[inline]
433
    #[must_use]
434
    pub fn as_u8vec2(self) -> crate::U8Vec2 {
4✔
435
        crate::U8Vec2::new(self.x as u8, self.y as u8)
4✔
436
    }
4✔
437

438
    /// Casts all elements of `self` to `i16`.
439
    #[cfg(feature = "i16")]
440
    #[inline]
441
    #[must_use]
442
    pub fn as_i16vec2(self) -> crate::I16Vec2 {
4✔
443
        crate::I16Vec2::new(self.x as i16, self.y as i16)
4✔
444
    }
4✔
445

446
    /// Casts all elements of `self` to `u16`.
447
    #[cfg(feature = "u16")]
448
    #[inline]
449
    #[must_use]
450
    pub fn as_u16vec2(self) -> crate::U16Vec2 {
4✔
451
        crate::U16Vec2::new(self.x as u16, self.y as u16)
4✔
452
    }
4✔
453

454
    /// Casts all elements of `self` to `i32`.
455
    #[cfg(feature = "i32")]
456
    #[inline]
457
    #[must_use]
458
    pub fn as_ivec2(self) -> crate::IVec2 {
4✔
459
        crate::IVec2::new(self.x as i32, self.y as i32)
4✔
460
    }
4✔
461

462
    /// Casts all elements of `self` to `u32`.
463
    #[cfg(feature = "u32")]
464
    #[inline]
465
    #[must_use]
466
    pub fn as_uvec2(self) -> crate::UVec2 {
4✔
467
        crate::UVec2::new(self.x as u32, self.y as u32)
4✔
468
    }
4✔
469

470
    /// Casts all elements of `self` to `i64`.
471
    #[cfg(feature = "i64")]
472
    #[inline]
473
    #[must_use]
474
    pub fn as_i64vec2(self) -> crate::I64Vec2 {
4✔
475
        crate::I64Vec2::new(self.x as i64, self.y as i64)
4✔
476
    }
4✔
477

478
    /// Casts all elements of `self` to `u64`.
479
    #[cfg(feature = "u64")]
480
    #[inline]
481
    #[must_use]
482
    pub fn as_u64vec2(self) -> crate::U64Vec2 {
4✔
483
        crate::U64Vec2::new(self.x as u64, self.y as u64)
4✔
484
    }
4✔
485

486
    /// Casts all elements of `self` to `isize`.
487
    #[cfg(feature = "isize")]
488
    #[inline]
489
    #[must_use]
490
    pub fn as_isizevec2(self) -> crate::ISizeVec2 {
4✔
491
        crate::ISizeVec2::new(self.x as isize, self.y as isize)
4✔
492
    }
4✔
493

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

509
        Some(Self { x, y })
4✔
510
    }
16✔
511

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

527
        Some(Self { x, y })
4✔
528
    }
16✔
529

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

545
        Some(Self { x, y })
16✔
546
    }
20✔
547

548
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
549
    ///
550
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
551
    #[inline]
552
    #[must_use]
553
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
20✔
554
        let x = match self.x.checked_div(rhs.x) {
20✔
555
            Some(v) => v,
12✔
556
            None => return None,
8✔
557
        };
558
        let y = match self.y.checked_div(rhs.y) {
12✔
559
            Some(v) => v,
8✔
560
            None => return None,
4✔
561
        };
562

563
        Some(Self { x, y })
8✔
564
    }
20✔
565

566
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
567
    ///
568
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
569
    #[inline]
570
    #[must_use]
571
    pub const fn wrapping_add(self, rhs: Self) -> Self {
4✔
572
        Self {
4✔
573
            x: self.x.wrapping_add(rhs.x),
4✔
574
            y: self.y.wrapping_add(rhs.y),
4✔
575
        }
4✔
576
    }
4✔
577

578
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
579
    ///
580
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
581
    #[inline]
582
    #[must_use]
583
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
4✔
584
        Self {
4✔
585
            x: self.x.wrapping_sub(rhs.x),
4✔
586
            y: self.y.wrapping_sub(rhs.y),
4✔
587
        }
4✔
588
    }
4✔
589

590
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
591
    ///
592
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
593
    #[inline]
594
    #[must_use]
595
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
4✔
596
        Self {
4✔
597
            x: self.x.wrapping_mul(rhs.x),
4✔
598
            y: self.y.wrapping_mul(rhs.y),
4✔
599
        }
4✔
600
    }
4✔
601

602
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
603
    ///
604
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
605
    #[inline]
606
    #[must_use]
607
    pub const fn wrapping_div(self, rhs: Self) -> Self {
4✔
608
        Self {
4✔
609
            x: self.x.wrapping_div(rhs.x),
4✔
610
            y: self.y.wrapping_div(rhs.y),
4✔
611
        }
4✔
612
    }
4✔
613

614
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
615
    ///
616
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
617
    #[inline]
618
    #[must_use]
619
    pub const fn saturating_add(self, rhs: Self) -> Self {
4✔
620
        Self {
4✔
621
            x: self.x.saturating_add(rhs.x),
4✔
622
            y: self.y.saturating_add(rhs.y),
4✔
623
        }
4✔
624
    }
4✔
625

626
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
627
    ///
628
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
629
    #[inline]
630
    #[must_use]
631
    pub const fn saturating_sub(self, rhs: Self) -> Self {
4✔
632
        Self {
4✔
633
            x: self.x.saturating_sub(rhs.x),
4✔
634
            y: self.y.saturating_sub(rhs.y),
4✔
635
        }
4✔
636
    }
4✔
637

638
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
639
    ///
640
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
641
    #[inline]
642
    #[must_use]
643
    pub const fn saturating_mul(self, rhs: Self) -> Self {
4✔
644
        Self {
4✔
645
            x: self.x.saturating_mul(rhs.x),
4✔
646
            y: self.y.saturating_mul(rhs.y),
4✔
647
        }
4✔
648
    }
4✔
649

650
    /// Returns a vector containing the saturating division of `self` and `rhs`.
651
    ///
652
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
653
    #[inline]
654
    #[must_use]
655
    pub const fn saturating_div(self, rhs: Self) -> Self {
4✔
656
        Self {
4✔
657
            x: self.x.saturating_div(rhs.x),
4✔
658
            y: self.y.saturating_div(rhs.y),
4✔
659
        }
4✔
660
    }
4✔
661

662
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
663
    ///
664
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
665
    #[cfg(feature = "isize")]
666
    #[inline]
667
    #[must_use]
668
    pub const fn checked_add_signed(self, rhs: ISizeVec2) -> Option<Self> {
8✔
669
        let x = match self.x.checked_add_signed(rhs.x) {
8✔
670
            Some(v) => v,
4✔
671
            None => return None,
4✔
672
        };
673
        let y = match self.y.checked_add_signed(rhs.y) {
4✔
674
            Some(v) => v,
4✔
675
            None => return None,
×
676
        };
677

678
        Some(Self { x, y })
4✔
679
    }
8✔
680

681
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
682
    ///
683
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
684
    #[cfg(feature = "isize")]
685
    #[inline]
686
    #[must_use]
687
    pub const fn wrapping_add_signed(self, rhs: ISizeVec2) -> Self {
4✔
688
        Self {
4✔
689
            x: self.x.wrapping_add_signed(rhs.x),
4✔
690
            y: self.y.wrapping_add_signed(rhs.y),
4✔
691
        }
4✔
692
    }
4✔
693

694
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
695
    ///
696
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
697
    #[cfg(feature = "isize")]
698
    #[inline]
699
    #[must_use]
700
    pub const fn saturating_add_signed(self, rhs: ISizeVec2) -> Self {
4✔
701
        Self {
4✔
702
            x: self.x.saturating_add_signed(rhs.x),
4✔
703
            y: self.y.saturating_add_signed(rhs.y),
4✔
704
        }
4✔
705
    }
4✔
706
}
707

708
impl Default for USizeVec2 {
709
    #[inline(always)]
710
    fn default() -> Self {
×
711
        Self::ZERO
×
712
    }
×
713
}
714

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

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

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

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

750
impl DivAssign for USizeVec2 {
751
    #[inline]
752
    fn div_assign(&mut self, rhs: Self) {
12✔
753
        self.x.div_assign(rhs.x);
12✔
754
        self.y.div_assign(rhs.y);
12✔
755
    }
12✔
756
}
757

758
impl DivAssign<&Self> for USizeVec2 {
759
    #[inline]
760
    fn div_assign(&mut self, rhs: &Self) {
4✔
761
        self.div_assign(*rhs);
4✔
762
    }
4✔
763
}
764

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

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

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

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

800
impl DivAssign<usize> for USizeVec2 {
801
    #[inline]
802
    fn div_assign(&mut self, rhs: usize) {
16✔
803
        self.x.div_assign(rhs);
16✔
804
        self.y.div_assign(rhs);
16✔
805
    }
16✔
806
}
807

808
impl DivAssign<&usize> for USizeVec2 {
809
    #[inline]
810
    fn div_assign(&mut self, rhs: &usize) {
4✔
811
        self.div_assign(*rhs);
4✔
812
    }
4✔
813
}
814

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

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

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

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

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

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

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

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

885
impl MulAssign for USizeVec2 {
886
    #[inline]
887
    fn mul_assign(&mut self, rhs: Self) {
12✔
888
        self.x.mul_assign(rhs.x);
12✔
889
        self.y.mul_assign(rhs.y);
12✔
890
    }
12✔
891
}
892

893
impl MulAssign<&Self> for USizeVec2 {
894
    #[inline]
895
    fn mul_assign(&mut self, rhs: &Self) {
4✔
896
        self.mul_assign(*rhs);
4✔
897
    }
4✔
898
}
899

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

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

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

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

935
impl MulAssign<usize> for USizeVec2 {
936
    #[inline]
937
    fn mul_assign(&mut self, rhs: usize) {
16✔
938
        self.x.mul_assign(rhs);
16✔
939
        self.y.mul_assign(rhs);
16✔
940
    }
16✔
941
}
942

943
impl MulAssign<&usize> for USizeVec2 {
944
    #[inline]
945
    fn mul_assign(&mut self, rhs: &usize) {
4✔
946
        self.mul_assign(*rhs);
4✔
947
    }
4✔
948
}
949

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

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

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

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

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

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

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

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

1020
impl AddAssign for USizeVec2 {
1021
    #[inline]
1022
    fn add_assign(&mut self, rhs: Self) {
12✔
1023
        self.x.add_assign(rhs.x);
12✔
1024
        self.y.add_assign(rhs.y);
12✔
1025
    }
12✔
1026
}
1027

1028
impl AddAssign<&Self> for USizeVec2 {
1029
    #[inline]
1030
    fn add_assign(&mut self, rhs: &Self) {
4✔
1031
        self.add_assign(*rhs);
4✔
1032
    }
4✔
1033
}
1034

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

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

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

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

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

1078
impl AddAssign<&usize> for USizeVec2 {
1079
    #[inline]
1080
    fn add_assign(&mut self, rhs: &usize) {
4✔
1081
        self.add_assign(*rhs);
4✔
1082
    }
4✔
1083
}
1084

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

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

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

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

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

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

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

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

1155
impl SubAssign for USizeVec2 {
1156
    #[inline]
1157
    fn sub_assign(&mut self, rhs: Self) {
12✔
1158
        self.x.sub_assign(rhs.x);
12✔
1159
        self.y.sub_assign(rhs.y);
12✔
1160
    }
12✔
1161
}
1162

1163
impl SubAssign<&Self> for USizeVec2 {
1164
    #[inline]
1165
    fn sub_assign(&mut self, rhs: &Self) {
4✔
1166
        self.sub_assign(*rhs);
4✔
1167
    }
4✔
1168
}
1169

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

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

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

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

1205
impl SubAssign<usize> for USizeVec2 {
1206
    #[inline]
1207
    fn sub_assign(&mut self, rhs: usize) {
12✔
1208
        self.x.sub_assign(rhs);
12✔
1209
        self.y.sub_assign(rhs);
12✔
1210
    }
12✔
1211
}
1212

1213
impl SubAssign<&usize> for USizeVec2 {
1214
    #[inline]
1215
    fn sub_assign(&mut self, rhs: &usize) {
4✔
1216
        self.sub_assign(*rhs);
4✔
1217
    }
4✔
1218
}
1219

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

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

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

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

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

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

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

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

1290
impl RemAssign for USizeVec2 {
1291
    #[inline]
1292
    fn rem_assign(&mut self, rhs: Self) {
16✔
1293
        self.x.rem_assign(rhs.x);
16✔
1294
        self.y.rem_assign(rhs.y);
16✔
1295
    }
16✔
1296
}
1297

1298
impl RemAssign<&Self> for USizeVec2 {
1299
    #[inline]
1300
    fn rem_assign(&mut self, rhs: &Self) {
4✔
1301
        self.rem_assign(*rhs);
4✔
1302
    }
4✔
1303
}
1304

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

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

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

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

1340
impl RemAssign<usize> for USizeVec2 {
1341
    #[inline]
1342
    fn rem_assign(&mut self, rhs: usize) {
12✔
1343
        self.x.rem_assign(rhs);
12✔
1344
        self.y.rem_assign(rhs);
12✔
1345
    }
12✔
1346
}
1347

1348
impl RemAssign<&usize> for USizeVec2 {
1349
    #[inline]
1350
    fn rem_assign(&mut self, rhs: &usize) {
4✔
1351
        self.rem_assign(*rhs);
4✔
1352
    }
4✔
1353
}
1354

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

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

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

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

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

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

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

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

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

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

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

1455
impl Not for &USizeVec2 {
1456
    type Output = USizeVec2;
1457
    #[inline]
1458
    fn not(self) -> USizeVec2 {
16✔
1459
        (*self).not()
16✔
1460
    }
16✔
1461
}
1462

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

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

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

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

1498
impl BitAndAssign for USizeVec2 {
1499
    #[inline]
1500
    fn bitand_assign(&mut self, rhs: Self) {
128✔
1501
        *self = self.bitand(rhs);
128✔
1502
    }
128✔
1503
}
1504

1505
impl BitAndAssign<&Self> for USizeVec2 {
1506
    #[inline]
1507
    fn bitand_assign(&mut self, rhs: &Self) {
64✔
1508
        self.bitand_assign(*rhs);
64✔
1509
    }
64✔
1510
}
1511

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

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

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

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

1547
impl BitOrAssign for USizeVec2 {
1548
    #[inline]
1549
    fn bitor_assign(&mut self, rhs: Self) {
128✔
1550
        *self = self.bitor(rhs);
128✔
1551
    }
128✔
1552
}
1553

1554
impl BitOrAssign<&Self> for USizeVec2 {
1555
    #[inline]
1556
    fn bitor_assign(&mut self, rhs: &Self) {
64✔
1557
        self.bitor_assign(*rhs);
64✔
1558
    }
64✔
1559
}
1560

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

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

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

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

1596
impl BitXorAssign for USizeVec2 {
1597
    #[inline]
1598
    fn bitxor_assign(&mut self, rhs: Self) {
128✔
1599
        *self = self.bitxor(rhs);
128✔
1600
    }
128✔
1601
}
1602

1603
impl BitXorAssign<&Self> for USizeVec2 {
1604
    #[inline]
1605
    fn bitxor_assign(&mut self, rhs: &Self) {
64✔
1606
        self.bitxor_assign(*rhs);
64✔
1607
    }
64✔
1608
}
1609

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

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

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

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

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

1652
impl BitAndAssign<&usize> for USizeVec2 {
1653
    #[inline]
1654
    fn bitand_assign(&mut self, rhs: &usize) {
32✔
1655
        self.bitand_assign(*rhs);
32✔
1656
    }
32✔
1657
}
1658

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

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

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

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

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

1701
impl BitOrAssign<&usize> for USizeVec2 {
1702
    #[inline]
1703
    fn bitor_assign(&mut self, rhs: &usize) {
32✔
1704
        self.bitor_assign(*rhs);
32✔
1705
    }
32✔
1706
}
1707

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

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

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

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

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

1750
impl BitXorAssign<&usize> for USizeVec2 {
1751
    #[inline]
1752
    fn bitxor_assign(&mut self, rhs: &usize) {
32✔
1753
        self.bitxor_assign(*rhs);
32✔
1754
    }
32✔
1755
}
1756

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

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

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

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

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

1799
impl ShlAssign<&i8> for USizeVec2 {
1800
    #[inline]
1801
    fn shl_assign(&mut self, rhs: &i8) {
32✔
1802
        self.shl_assign(*rhs);
32✔
1803
    }
32✔
1804
}
1805

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

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

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

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

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

1848
impl ShrAssign<&i8> for USizeVec2 {
1849
    #[inline]
1850
    fn shr_assign(&mut self, rhs: &i8) {
32✔
1851
        self.shr_assign(*rhs);
32✔
1852
    }
32✔
1853
}
1854

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

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

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

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

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

1897
impl ShlAssign<&i16> for USizeVec2 {
1898
    #[inline]
1899
    fn shl_assign(&mut self, rhs: &i16) {
32✔
1900
        self.shl_assign(*rhs);
32✔
1901
    }
32✔
1902
}
1903

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

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

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

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

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

1946
impl ShrAssign<&i16> for USizeVec2 {
1947
    #[inline]
1948
    fn shr_assign(&mut self, rhs: &i16) {
32✔
1949
        self.shr_assign(*rhs);
32✔
1950
    }
32✔
1951
}
1952

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

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

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

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

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

1995
impl ShlAssign<&i32> for USizeVec2 {
1996
    #[inline]
1997
    fn shl_assign(&mut self, rhs: &i32) {
32✔
1998
        self.shl_assign(*rhs);
32✔
1999
    }
32✔
2000
}
2001

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

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

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

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

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

2044
impl ShrAssign<&i32> for USizeVec2 {
2045
    #[inline]
2046
    fn shr_assign(&mut self, rhs: &i32) {
32✔
2047
        self.shr_assign(*rhs);
32✔
2048
    }
32✔
2049
}
2050

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

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

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

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

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

2093
impl ShlAssign<&i64> for USizeVec2 {
2094
    #[inline]
2095
    fn shl_assign(&mut self, rhs: &i64) {
32✔
2096
        self.shl_assign(*rhs);
32✔
2097
    }
32✔
2098
}
2099

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

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

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

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

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

2142
impl ShrAssign<&i64> for USizeVec2 {
2143
    #[inline]
2144
    fn shr_assign(&mut self, rhs: &i64) {
32✔
2145
        self.shr_assign(*rhs);
32✔
2146
    }
32✔
2147
}
2148

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

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

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

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

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

2191
impl ShlAssign<&u8> for USizeVec2 {
2192
    #[inline]
2193
    fn shl_assign(&mut self, rhs: &u8) {
32✔
2194
        self.shl_assign(*rhs);
32✔
2195
    }
32✔
2196
}
2197

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

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

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

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

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

2240
impl ShrAssign<&u8> for USizeVec2 {
2241
    #[inline]
2242
    fn shr_assign(&mut self, rhs: &u8) {
32✔
2243
        self.shr_assign(*rhs);
32✔
2244
    }
32✔
2245
}
2246

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

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

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

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

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

2289
impl ShlAssign<&u16> for USizeVec2 {
2290
    #[inline]
2291
    fn shl_assign(&mut self, rhs: &u16) {
32✔
2292
        self.shl_assign(*rhs);
32✔
2293
    }
32✔
2294
}
2295

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

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

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

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

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

2338
impl ShrAssign<&u16> for USizeVec2 {
2339
    #[inline]
2340
    fn shr_assign(&mut self, rhs: &u16) {
32✔
2341
        self.shr_assign(*rhs);
32✔
2342
    }
32✔
2343
}
2344

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

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

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

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

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

2387
impl ShlAssign<&u32> for USizeVec2 {
2388
    #[inline]
2389
    fn shl_assign(&mut self, rhs: &u32) {
32✔
2390
        self.shl_assign(*rhs);
32✔
2391
    }
32✔
2392
}
2393

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

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

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

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

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

2436
impl ShrAssign<&u32> for USizeVec2 {
2437
    #[inline]
2438
    fn shr_assign(&mut self, rhs: &u32) {
32✔
2439
        self.shr_assign(*rhs);
32✔
2440
    }
32✔
2441
}
2442

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

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

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

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

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

2485
impl ShlAssign<&u64> for USizeVec2 {
2486
    #[inline]
2487
    fn shl_assign(&mut self, rhs: &u64) {
32✔
2488
        self.shl_assign(*rhs);
32✔
2489
    }
32✔
2490
}
2491

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

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

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

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

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

2534
impl ShrAssign<&u64> for USizeVec2 {
2535
    #[inline]
2536
    fn shr_assign(&mut self, rhs: &u64) {
32✔
2537
        self.shr_assign(*rhs);
32✔
2538
    }
32✔
2539
}
2540

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

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

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

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

2580
#[cfg(feature = "i32")]
2581
impl Shr<IVec2> for USizeVec2 {
2582
    type Output = Self;
2583
    #[inline]
2584
    fn shr(self, rhs: IVec2) -> Self {
256✔
2585
        Self {
256✔
2586
            x: self.x.shr(rhs.x),
256✔
2587
            y: self.y.shr(rhs.y),
256✔
2588
        }
256✔
2589
    }
256✔
2590
}
2591

2592
#[cfg(feature = "i32")]
2593
impl Shr<&IVec2> for USizeVec2 {
2594
    type Output = Self;
2595
    #[inline]
2596
    fn shr(self, rhs: &IVec2) -> Self {
64✔
2597
        self.shr(*rhs)
64✔
2598
    }
64✔
2599
}
2600

2601
#[cfg(feature = "i32")]
2602
impl Shr<&IVec2> for &USizeVec2 {
2603
    type Output = USizeVec2;
2604
    #[inline]
2605
    fn shr(self, rhs: &IVec2) -> USizeVec2 {
64✔
2606
        (*self).shr(*rhs)
64✔
2607
    }
64✔
2608
}
2609

2610
#[cfg(feature = "i32")]
2611
impl Shr<IVec2> for &USizeVec2 {
2612
    type Output = USizeVec2;
2613
    #[inline]
2614
    fn shr(self, rhs: IVec2) -> USizeVec2 {
64✔
2615
        (*self).shr(rhs)
64✔
2616
    }
64✔
2617
}
2618

2619
#[cfg(feature = "u32")]
2620
impl Shl<UVec2> for USizeVec2 {
2621
    type Output = Self;
2622
    #[inline]
2623
    fn shl(self, rhs: UVec2) -> Self {
256✔
2624
        Self {
256✔
2625
            x: self.x.shl(rhs.x),
256✔
2626
            y: self.y.shl(rhs.y),
256✔
2627
        }
256✔
2628
    }
256✔
2629
}
2630

2631
#[cfg(feature = "u32")]
2632
impl Shl<&UVec2> for USizeVec2 {
2633
    type Output = Self;
2634
    #[inline]
2635
    fn shl(self, rhs: &UVec2) -> Self {
64✔
2636
        self.shl(*rhs)
64✔
2637
    }
64✔
2638
}
2639

2640
#[cfg(feature = "u32")]
2641
impl Shl<&UVec2> for &USizeVec2 {
2642
    type Output = USizeVec2;
2643
    #[inline]
2644
    fn shl(self, rhs: &UVec2) -> USizeVec2 {
64✔
2645
        (*self).shl(*rhs)
64✔
2646
    }
64✔
2647
}
2648

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

2658
#[cfg(feature = "u32")]
2659
impl Shr<UVec2> for USizeVec2 {
2660
    type Output = Self;
2661
    #[inline]
2662
    fn shr(self, rhs: UVec2) -> Self {
256✔
2663
        Self {
256✔
2664
            x: self.x.shr(rhs.x),
256✔
2665
            y: self.y.shr(rhs.y),
256✔
2666
        }
256✔
2667
    }
256✔
2668
}
2669

2670
#[cfg(feature = "u32")]
2671
impl Shr<&UVec2> for USizeVec2 {
2672
    type Output = Self;
2673
    #[inline]
2674
    fn shr(self, rhs: &UVec2) -> Self {
64✔
2675
        self.shr(*rhs)
64✔
2676
    }
64✔
2677
}
2678

2679
#[cfg(feature = "u32")]
2680
impl Shr<&UVec2> for &USizeVec2 {
2681
    type Output = USizeVec2;
2682
    #[inline]
2683
    fn shr(self, rhs: &UVec2) -> USizeVec2 {
64✔
2684
        (*self).shr(*rhs)
64✔
2685
    }
64✔
2686
}
2687

2688
#[cfg(feature = "u32")]
2689
impl Shr<UVec2> for &USizeVec2 {
2690
    type Output = USizeVec2;
2691
    #[inline]
2692
    fn shr(self, rhs: UVec2) -> USizeVec2 {
64✔
2693
        (*self).shr(rhs)
64✔
2694
    }
64✔
2695
}
2696

2697
impl Index<usize> for USizeVec2 {
2698
    type Output = usize;
2699
    #[inline]
2700
    fn index(&self, index: usize) -> &Self::Output {
8✔
2701
        match index {
8✔
2702
            0 => &self.x,
4✔
2703
            1 => &self.y,
4✔
2704
            _ => panic!("index out of bounds"),
×
2705
        }
2706
    }
8✔
2707
}
2708

2709
impl IndexMut<usize> for USizeVec2 {
2710
    #[inline]
2711
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
8✔
2712
        match index {
8✔
2713
            0 => &mut self.x,
4✔
2714
            1 => &mut self.y,
4✔
2715
            _ => panic!("index out of bounds"),
×
2716
        }
2717
    }
8✔
2718
}
2719

2720
impl fmt::Display for USizeVec2 {
2721
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4✔
2722
        write!(f, "[{}, {}]", self.x, self.y)
4✔
2723
    }
4✔
2724
}
2725

2726
impl fmt::Debug for USizeVec2 {
2727
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
8✔
2728
        fmt.debug_tuple(stringify!(USizeVec2))
8✔
2729
            .field(&self.x)
8✔
2730
            .field(&self.y)
8✔
2731
            .finish()
8✔
2732
    }
8✔
2733
}
2734

2735
impl From<[usize; 2]> for USizeVec2 {
2736
    #[inline]
2737
    fn from(a: [usize; 2]) -> Self {
4✔
2738
        Self::new(a[0], a[1])
4✔
2739
    }
4✔
2740
}
2741

2742
impl From<USizeVec2> for [usize; 2] {
2743
    #[inline]
2744
    fn from(v: USizeVec2) -> Self {
4✔
2745
        [v.x, v.y]
4✔
2746
    }
4✔
2747
}
2748

2749
impl From<(usize, usize)> for USizeVec2 {
2750
    #[inline]
2751
    fn from(t: (usize, usize)) -> Self {
4✔
2752
        Self::new(t.0, t.1)
4✔
2753
    }
4✔
2754
}
2755

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

2763
#[cfg(feature = "u8")]
2764
impl From<U8Vec2> for USizeVec2 {
2765
    #[inline]
2766
    fn from(v: U8Vec2) -> Self {
4✔
2767
        Self::new(usize::from(v.x), usize::from(v.y))
4✔
2768
    }
4✔
2769
}
2770

2771
#[cfg(feature = "u16")]
2772
impl From<U16Vec2> for USizeVec2 {
2773
    #[inline]
2774
    fn from(v: U16Vec2) -> Self {
4✔
2775
        Self::new(usize::from(v.x), usize::from(v.y))
4✔
2776
    }
4✔
2777
}
2778

2779
#[cfg(feature = "i8")]
2780
impl TryFrom<I8Vec2> for USizeVec2 {
2781
    type Error = core::num::TryFromIntError;
2782

2783
    #[inline]
2784
    fn try_from(v: I8Vec2) -> Result<Self, Self::Error> {
12✔
2785
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
12✔
2786
    }
12✔
2787
}
2788

2789
#[cfg(feature = "i16")]
2790
impl TryFrom<I16Vec2> for USizeVec2 {
2791
    type Error = core::num::TryFromIntError;
2792

2793
    #[inline]
2794
    fn try_from(v: I16Vec2) -> Result<Self, Self::Error> {
12✔
2795
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
12✔
2796
    }
12✔
2797
}
2798

2799
#[cfg(feature = "i32")]
2800
impl TryFrom<IVec2> for USizeVec2 {
2801
    type Error = core::num::TryFromIntError;
2802

2803
    #[inline]
2804
    fn try_from(v: IVec2) -> Result<Self, Self::Error> {
12✔
2805
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
12✔
2806
    }
12✔
2807
}
2808

2809
#[cfg(feature = "i64")]
2810
impl TryFrom<I64Vec2> for USizeVec2 {
2811
    type Error = core::num::TryFromIntError;
2812

2813
    #[inline]
2814
    fn try_from(v: I64Vec2) -> Result<Self, Self::Error> {
12✔
2815
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
12✔
2816
    }
12✔
2817
}
2818

2819
#[cfg(feature = "u32")]
2820
impl TryFrom<UVec2> for USizeVec2 {
2821
    type Error = core::num::TryFromIntError;
2822

2823
    #[inline]
2824
    fn try_from(v: UVec2) -> Result<Self, Self::Error> {
4✔
2825
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
4✔
2826
    }
4✔
2827
}
2828

2829
#[cfg(feature = "u64")]
2830
impl TryFrom<U64Vec2> for USizeVec2 {
2831
    type Error = core::num::TryFromIntError;
2832

2833
    #[inline]
2834
    fn try_from(v: U64Vec2) -> Result<Self, Self::Error> {
4✔
2835
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
4✔
2836
    }
4✔
2837
}
2838

2839
#[cfg(feature = "isize")]
2840
impl TryFrom<ISizeVec2> for USizeVec2 {
2841
    type Error = core::num::TryFromIntError;
2842

2843
    #[inline]
2844
    fn try_from(v: ISizeVec2) -> Result<Self, Self::Error> {
12✔
2845
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
12✔
2846
    }
12✔
2847
}
2848

2849
impl From<BVec2> for USizeVec2 {
2850
    #[inline]
2851
    fn from(v: BVec2) -> Self {
8✔
2852
        Self::new(usize::from(v.x), usize::from(v.y))
8✔
2853
    }
8✔
2854
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc