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

bitshifter / glam-rs / 21560716727

01 Feb 2026 09:46AM UTC coverage: 97.127% (+0.04%) from 97.086%
21560716727

Pull #712

github

bitshifter
More missing tests.
Pull Request #712: Add ISizeVecN types

4031 of 4126 new or added lines in 44 files covered. (97.7%)

1 existing line in 1 file now uncovered.

57206 of 58898 relevant lines covered (97.13%)

3.46 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::{
4
    BVec2, I16Vec2, I64Vec2, I8Vec2, ISizeVec2, IVec2, U16Vec2, U64Vec2, U8Vec2, USizeVec3, UVec2,
5
};
6

7
use core::fmt;
8
use core::iter::{Product, Sum};
9
use core::{f32, ops::*};
10

11
#[cfg(feature = "zerocopy")]
12
use zerocopy_derive::*;
13

14
/// Creates a 2-dimensional vector.
15
#[inline(always)]
16
#[must_use]
17
pub const fn usizevec2(x: usize, y: usize) -> USizeVec2 {
6✔
18
    USizeVec2::new(x, y)
×
19
}
20

21
/// A 2-dimensional vector.
22
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
23
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
24
#[cfg_attr(
25
    feature = "zerocopy",
26
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
27
)]
28
#[cfg_attr(feature = "cuda", repr(align(16)))]
29
#[repr(C)]
30
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
31
pub struct USizeVec2 {
32
    pub x: usize,
33
    pub y: usize,
34
}
35

36
impl USizeVec2 {
37
    /// All zeroes.
38
    pub const ZERO: Self = Self::splat(0);
39

40
    /// All ones.
41
    pub const ONE: Self = Self::splat(1);
42

43
    /// All `usize::MIN`.
44
    pub const MIN: Self = Self::splat(usize::MIN);
45

46
    /// All `usize::MAX`.
47
    pub const MAX: Self = Self::splat(usize::MAX);
48

49
    /// A unit vector pointing along the positive X axis.
50
    pub const X: Self = Self::new(1, 0);
51

52
    /// A unit vector pointing along the positive Y axis.
53
    pub const Y: Self = Self::new(0, 1);
54

55
    /// The unit axes.
56
    pub const AXES: [Self; 2] = [Self::X, Self::Y];
57

58
    /// Creates a new vector.
59
    #[inline(always)]
60
    #[must_use]
61
    pub const fn new(x: usize, y: usize) -> Self {
9✔
62
        Self { x, y }
63
    }
64

65
    /// Creates a vector with all elements set to `v`.
66
    #[inline]
67
    #[must_use]
68
    pub const fn splat(v: usize) -> Self {
3✔
69
        Self { x: v, y: v }
70
    }
71

72
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
73
    #[inline]
74
    #[must_use]
75
    pub fn map<F>(self, f: F) -> Self
6✔
76
    where
77
        F: Fn(usize) -> usize,
78
    {
79
        Self::new(f(self.x), f(self.y))
12✔
80
    }
81

82
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
83
    /// for each element of `self`.
84
    ///
85
    /// A true element in the mask uses the corresponding element from `if_true`, and false
86
    /// uses the element from `if_false`.
87
    #[inline]
88
    #[must_use]
89
    pub fn select(mask: BVec2, if_true: Self, if_false: Self) -> Self {
3✔
90
        Self {
91
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
92
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
93
        }
94
    }
95

96
    /// Creates a new vector from an array.
97
    #[inline]
98
    #[must_use]
99
    pub const fn from_array(a: [usize; 2]) -> Self {
×
100
        Self::new(a[0], a[1])
×
101
    }
102

103
    /// Converts `self` to `[x, y]`
104
    #[inline]
105
    #[must_use]
106
    pub const fn to_array(&self) -> [usize; 2] {
3✔
107
        [self.x, self.y]
3✔
108
    }
109

110
    /// Creates a vector from the first 2 values in `slice`.
111
    ///
112
    /// # Panics
113
    ///
114
    /// Panics if `slice` is less than 2 elements long.
115
    #[inline]
116
    #[must_use]
117
    pub const fn from_slice(slice: &[usize]) -> Self {
3✔
118
        assert!(slice.len() >= 2);
3✔
119
        Self::new(slice[0], slice[1])
3✔
120
    }
121

122
    /// Writes the elements of `self` to the first 2 elements in `slice`.
123
    ///
124
    /// # Panics
125
    ///
126
    /// Panics if `slice` is less than 2 elements long.
127
    #[inline]
128
    pub fn write_to_slice(self, slice: &mut [usize]) {
3✔
129
        slice[..2].copy_from_slice(&self.to_array());
3✔
130
    }
131

132
    /// Creates a 3D vector from `self` and the given `z` value.
133
    #[inline]
134
    #[must_use]
135
    pub const fn extend(self, z: usize) -> USizeVec3 {
3✔
136
        USizeVec3::new(self.x, self.y, z)
3✔
137
    }
138

139
    /// Creates a 2D vector from `self` with the given value of `x`.
140
    #[inline]
141
    #[must_use]
142
    pub fn with_x(mut self, x: usize) -> Self {
3✔
143
        self.x = x;
3✔
144
        self
3✔
145
    }
146

147
    /// Creates a 2D vector from `self` with the given value of `y`.
148
    #[inline]
149
    #[must_use]
150
    pub fn with_y(mut self, y: usize) -> Self {
3✔
151
        self.y = y;
3✔
152
        self
3✔
153
    }
154

155
    /// Computes the dot product of `self` and `rhs`.
156
    #[inline]
157
    #[must_use]
158
    pub fn dot(self, rhs: Self) -> usize {
3✔
159
        (self.x * rhs.x) + (self.y * rhs.y)
3✔
160
    }
161

162
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
163
    #[inline]
164
    #[must_use]
165
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
166
        Self::splat(self.dot(rhs))
3✔
167
    }
168

169
    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
170
    ///
171
    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
172
    #[inline]
173
    #[must_use]
174
    pub fn min(self, rhs: Self) -> Self {
3✔
175
        Self {
176
            x: if self.x < rhs.x { self.x } else { rhs.x },
3✔
177
            y: if self.y < rhs.y { self.y } else { rhs.y },
3✔
178
        }
179
    }
180

181
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
182
    ///
183
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
184
    #[inline]
185
    #[must_use]
186
    pub fn max(self, rhs: Self) -> Self {
3✔
187
        Self {
188
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
189
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
190
        }
191
    }
192

193
    /// Component-wise clamping of values, similar to [`usize::clamp`].
194
    ///
195
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
196
    ///
197
    /// # Panics
198
    ///
199
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
200
    #[inline]
201
    #[must_use]
202
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
203
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
204
        self.max(min).min(max)
3✔
205
    }
206

207
    /// Returns the horizontal minimum of `self`.
208
    ///
209
    /// In other words this computes `min(x, y, ..)`.
210
    #[inline]
211
    #[must_use]
212
    pub fn min_element(self) -> usize {
3✔
213
        let min = |a, b| if a < b { a } else { b };
6✔
214
        min(self.x, self.y)
3✔
215
    }
216

217
    /// Returns the horizontal maximum of `self`.
218
    ///
219
    /// In other words this computes `max(x, y, ..)`.
220
    #[inline]
221
    #[must_use]
222
    pub fn max_element(self) -> usize {
3✔
223
        let max = |a, b| if a > b { a } else { b };
6✔
224
        max(self.x, self.y)
3✔
225
    }
226

227
    /// Returns the index of the first minimum element of `self`.
228
    #[doc(alias = "argmin")]
229
    #[inline]
230
    #[must_use]
231
    pub fn min_position(self) -> usize {
3✔
232
        if self.x <= self.y {
6✔
233
            0
3✔
234
        } else {
235
            1
3✔
236
        }
237
    }
238

239
    /// Returns the index of the first maximum element of `self`.
240
    #[doc(alias = "argmax")]
241
    #[inline]
242
    #[must_use]
243
    pub fn max_position(self) -> usize {
3✔
244
        if self.x >= self.y {
6✔
245
            0
3✔
246
        } else {
247
            1
3✔
248
        }
249
    }
250

251
    /// Returns the sum of all elements of `self`.
252
    ///
253
    /// In other words, this computes `self.x + self.y + ..`.
254
    #[inline]
255
    #[must_use]
256
    pub fn element_sum(self) -> usize {
3✔
257
        self.x + self.y
3✔
258
    }
259

260
    /// Returns the product of all elements of `self`.
261
    ///
262
    /// In other words, this computes `self.x * self.y * ..`.
263
    #[inline]
264
    #[must_use]
265
    pub fn element_product(self) -> usize {
3✔
266
        self.x * self.y
3✔
267
    }
268

269
    /// Returns a vector mask containing the result of a `==` comparison for each element of
270
    /// `self` and `rhs`.
271
    ///
272
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
273
    /// elements.
274
    #[inline]
275
    #[must_use]
276
    pub fn cmpeq(self, rhs: Self) -> BVec2 {
3✔
277
        BVec2::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y))
3✔
278
    }
279

280
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
281
    /// `self` and `rhs`.
282
    ///
283
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
284
    /// elements.
285
    #[inline]
286
    #[must_use]
287
    pub fn cmpne(self, rhs: Self) -> BVec2 {
3✔
288
        BVec2::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y))
3✔
289
    }
290

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

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

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

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

335
    /// Computes the squared length of `self`.
336
    #[doc(alias = "magnitude2")]
337
    #[inline]
338
    #[must_use]
339
    pub fn length_squared(self) -> usize {
3✔
340
        self.dot(self)
3✔
341
    }
342

343
    /// Computes the [manhattan distance] between two points.
344
    ///
345
    /// # Overflow
346
    /// This method may overflow if the result is greater than [`usize::MAX`].
347
    ///
348
    /// See also [`checked_manhattan_distance`][USizeVec2::checked_manhattan_distance].
349
    ///
350
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
351
    #[inline]
352
    #[must_use]
353
    pub fn manhattan_distance(self, rhs: Self) -> usize {
3✔
354
        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y)
3✔
355
    }
356

357
    /// Computes the [manhattan distance] between two points.
358
    ///
359
    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
360
    ///
361
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
362
    #[inline]
363
    #[must_use]
364
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
3✔
365
        let d = self.x.abs_diff(rhs.x);
3✔
366
        d.checked_add(self.y.abs_diff(rhs.y))
3✔
367
    }
368

369
    /// Computes the [chebyshev distance] between two points.
370
    ///
371
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
372
    #[inline]
373
    #[must_use]
374
    pub fn chebyshev_distance(self, rhs: Self) -> usize {
3✔
375
        // Note: the compiler will eventually optimize out the loop
376
        [self.x.abs_diff(rhs.x), self.y.abs_diff(rhs.y)]
3✔
377
            .into_iter()
378
            .max()
379
            .unwrap()
380
    }
381

382
    /// Casts all elements of `self` to `f32`.
383
    #[inline]
384
    #[must_use]
385
    pub fn as_vec2(self) -> crate::Vec2 {
3✔
386
        crate::Vec2::new(self.x as f32, self.y as f32)
9✔
387
    }
388

389
    /// Casts all elements of `self` to `f64`.
390
    #[inline]
391
    #[must_use]
392
    pub fn as_dvec2(self) -> crate::DVec2 {
3✔
393
        crate::DVec2::new(self.x as f64, self.y as f64)
3✔
394
    }
395

396
    /// Casts all elements of `self` to `i8`.
397
    #[inline]
398
    #[must_use]
399
    pub fn as_i8vec2(self) -> crate::I8Vec2 {
3✔
400
        crate::I8Vec2::new(self.x as i8, self.y as i8)
3✔
401
    }
402

403
    /// Casts all elements of `self` to `u8`.
404
    #[inline]
405
    #[must_use]
406
    pub fn as_u8vec2(self) -> crate::U8Vec2 {
3✔
407
        crate::U8Vec2::new(self.x as u8, self.y as u8)
3✔
408
    }
409

410
    /// Casts all elements of `self` to `i16`.
411
    #[inline]
412
    #[must_use]
413
    pub fn as_i16vec2(self) -> crate::I16Vec2 {
3✔
414
        crate::I16Vec2::new(self.x as i16, self.y as i16)
3✔
415
    }
416

417
    /// Casts all elements of `self` to `u16`.
418
    #[inline]
419
    #[must_use]
420
    pub fn as_u16vec2(self) -> crate::U16Vec2 {
3✔
421
        crate::U16Vec2::new(self.x as u16, self.y as u16)
3✔
422
    }
423

424
    /// Casts all elements of `self` to `i32`.
425
    #[inline]
426
    #[must_use]
427
    pub fn as_ivec2(self) -> crate::IVec2 {
3✔
428
        crate::IVec2::new(self.x as i32, self.y as i32)
3✔
429
    }
430

431
    /// Casts all elements of `self` to `u32`.
432
    #[inline]
433
    #[must_use]
434
    pub fn as_uvec2(self) -> crate::UVec2 {
3✔
435
        crate::UVec2::new(self.x as u32, self.y as u32)
3✔
436
    }
437

438
    /// Casts all elements of `self` to `i64`.
439
    #[inline]
440
    #[must_use]
441
    pub fn as_i64vec2(self) -> crate::I64Vec2 {
3✔
442
        crate::I64Vec2::new(self.x as i64, self.y as i64)
3✔
443
    }
444

445
    /// Casts all elements of `self` to `u64`.
446
    #[inline]
447
    #[must_use]
448
    pub fn as_u64vec2(self) -> crate::U64Vec2 {
3✔
449
        crate::U64Vec2::new(self.x as u64, self.y as u64)
3✔
450
    }
451

452
    /// Casts all elements of `self` to `isize`.
453
    #[inline]
454
    #[must_use]
455
    pub fn as_isizevec2(self) -> crate::ISizeVec2 {
3✔
456
        crate::ISizeVec2::new(self.x as isize, self.y as isize)
3✔
457
    }
458

459
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
460
    ///
461
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
462
    #[inline]
463
    #[must_use]
464
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
465
        let x = match self.x.checked_add(rhs.x) {
3✔
466
            Some(v) => v,
3✔
467
            None => return None,
3✔
468
        };
469
        let y = match self.y.checked_add(rhs.y) {
3✔
470
            Some(v) => v,
3✔
471
            None => return None,
3✔
472
        };
473

474
        Some(Self { x, y })
3✔
475
    }
476

477
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
478
    ///
479
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
480
    #[inline]
481
    #[must_use]
482
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
483
        let x = match self.x.checked_sub(rhs.x) {
3✔
484
            Some(v) => v,
3✔
485
            None => return None,
3✔
486
        };
487
        let y = match self.y.checked_sub(rhs.y) {
3✔
488
            Some(v) => v,
3✔
489
            None => return None,
3✔
490
        };
491

492
        Some(Self { x, y })
3✔
493
    }
494

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

510
        Some(Self { x, y })
3✔
511
    }
512

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

528
        Some(Self { x, y })
3✔
529
    }
530

531
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
532
    ///
533
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
534
    #[inline]
535
    #[must_use]
536
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
537
        Self {
538
            x: self.x.wrapping_add(rhs.x),
3✔
539
            y: self.y.wrapping_add(rhs.y),
3✔
540
        }
541
    }
542

543
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
544
    ///
545
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
546
    #[inline]
547
    #[must_use]
548
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
549
        Self {
550
            x: self.x.wrapping_sub(rhs.x),
3✔
551
            y: self.y.wrapping_sub(rhs.y),
3✔
552
        }
553
    }
554

555
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
556
    ///
557
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
558
    #[inline]
559
    #[must_use]
560
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
561
        Self {
562
            x: self.x.wrapping_mul(rhs.x),
3✔
563
            y: self.y.wrapping_mul(rhs.y),
3✔
564
        }
565
    }
566

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

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

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

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

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

627
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
628
    ///
629
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
630
    #[inline]
631
    #[must_use]
632
    pub const fn checked_add_signed(self, rhs: ISizeVec2) -> Option<Self> {
3✔
633
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
634
            Some(v) => v,
3✔
635
            None => return None,
3✔
636
        };
637
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
638
            Some(v) => v,
3✔
NEW
639
            None => return None,
×
640
        };
641

642
        Some(Self { x, y })
3✔
643
    }
644

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

657
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
658
    ///
659
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
660
    #[inline]
661
    #[must_use]
662
    pub const fn saturating_add_signed(self, rhs: ISizeVec2) -> Self {
3✔
663
        Self {
664
            x: self.x.saturating_add_signed(rhs.x),
3✔
665
            y: self.y.saturating_add_signed(rhs.y),
3✔
666
        }
667
    }
668
}
669

670
impl Default for USizeVec2 {
671
    #[inline(always)]
672
    fn default() -> Self {
3✔
673
        Self::ZERO
×
674
    }
675
}
676

677
impl Div for USizeVec2 {
678
    type Output = Self;
679
    #[inline]
680
    fn div(self, rhs: Self) -> Self {
3✔
681
        Self {
682
            x: self.x.div(rhs.x),
3✔
683
            y: self.y.div(rhs.y),
3✔
684
        }
685
    }
686
}
687

688
impl Div<&Self> for USizeVec2 {
689
    type Output = Self;
690
    #[inline]
691
    fn div(self, rhs: &Self) -> Self {
3✔
692
        self.div(*rhs)
3✔
693
    }
694
}
695

696
impl Div<&USizeVec2> for &USizeVec2 {
697
    type Output = USizeVec2;
698
    #[inline]
699
    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
700
        (*self).div(*rhs)
3✔
701
    }
702
}
703

704
impl Div<USizeVec2> for &USizeVec2 {
705
    type Output = USizeVec2;
706
    #[inline]
707
    fn div(self, rhs: USizeVec2) -> USizeVec2 {
3✔
708
        (*self).div(rhs)
3✔
709
    }
710
}
711

712
impl DivAssign for USizeVec2 {
713
    #[inline]
714
    fn div_assign(&mut self, rhs: Self) {
3✔
715
        self.x.div_assign(rhs.x);
3✔
716
        self.y.div_assign(rhs.y);
5✔
717
    }
718
}
719

720
impl DivAssign<&Self> for USizeVec2 {
721
    #[inline]
722
    fn div_assign(&mut self, rhs: &Self) {
3✔
723
        self.div_assign(*rhs);
3✔
724
    }
725
}
726

727
impl Div<usize> for USizeVec2 {
728
    type Output = Self;
729
    #[inline]
730
    fn div(self, rhs: usize) -> Self {
3✔
731
        Self {
732
            x: self.x.div(rhs),
3✔
733
            y: self.y.div(rhs),
3✔
734
        }
735
    }
736
}
737

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

746
impl Div<&usize> for &USizeVec2 {
747
    type Output = USizeVec2;
748
    #[inline]
749
    fn div(self, rhs: &usize) -> USizeVec2 {
3✔
750
        (*self).div(*rhs)
3✔
751
    }
752
}
753

754
impl Div<usize> for &USizeVec2 {
755
    type Output = USizeVec2;
756
    #[inline]
757
    fn div(self, rhs: usize) -> USizeVec2 {
3✔
758
        (*self).div(rhs)
3✔
759
    }
760
}
761

762
impl DivAssign<usize> for USizeVec2 {
763
    #[inline]
764
    fn div_assign(&mut self, rhs: usize) {
3✔
765
        self.x.div_assign(rhs);
3✔
766
        self.y.div_assign(rhs);
4✔
767
    }
768
}
769

770
impl DivAssign<&usize> for USizeVec2 {
771
    #[inline]
772
    fn div_assign(&mut self, rhs: &usize) {
3✔
773
        self.div_assign(*rhs);
3✔
774
    }
775
}
776

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

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

796
impl Div<&USizeVec2> for &usize {
797
    type Output = USizeVec2;
798
    #[inline]
799
    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
800
        (*self).div(*rhs)
3✔
801
    }
802
}
803

804
impl Div<USizeVec2> for &usize {
805
    type Output = USizeVec2;
806
    #[inline]
807
    fn div(self, rhs: USizeVec2) -> USizeVec2 {
3✔
808
        (*self).div(rhs)
3✔
809
    }
810
}
811

812
impl Mul for USizeVec2 {
813
    type Output = Self;
814
    #[inline]
815
    fn mul(self, rhs: Self) -> Self {
4✔
816
        Self {
817
            x: self.x.mul(rhs.x),
4✔
818
            y: self.y.mul(rhs.y),
6✔
819
        }
820
    }
821
}
822

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

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

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

847
impl MulAssign for USizeVec2 {
848
    #[inline]
849
    fn mul_assign(&mut self, rhs: Self) {
3✔
850
        self.x.mul_assign(rhs.x);
3✔
851
        self.y.mul_assign(rhs.y);
5✔
852
    }
853
}
854

855
impl MulAssign<&Self> for USizeVec2 {
856
    #[inline]
857
    fn mul_assign(&mut self, rhs: &Self) {
3✔
858
        self.mul_assign(*rhs);
3✔
859
    }
860
}
861

862
impl Mul<usize> for USizeVec2 {
863
    type Output = Self;
864
    #[inline]
865
    fn mul(self, rhs: usize) -> Self {
3✔
866
        Self {
867
            x: self.x.mul(rhs),
3✔
868
            y: self.y.mul(rhs),
3✔
869
        }
870
    }
871
}
872

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

881
impl Mul<&usize> for &USizeVec2 {
882
    type Output = USizeVec2;
883
    #[inline]
884
    fn mul(self, rhs: &usize) -> USizeVec2 {
3✔
885
        (*self).mul(*rhs)
3✔
886
    }
887
}
888

889
impl Mul<usize> for &USizeVec2 {
890
    type Output = USizeVec2;
891
    #[inline]
892
    fn mul(self, rhs: usize) -> USizeVec2 {
3✔
893
        (*self).mul(rhs)
3✔
894
    }
895
}
896

897
impl MulAssign<usize> for USizeVec2 {
898
    #[inline]
899
    fn mul_assign(&mut self, rhs: usize) {
3✔
900
        self.x.mul_assign(rhs);
3✔
901
        self.y.mul_assign(rhs);
4✔
902
    }
903
}
904

905
impl MulAssign<&usize> for USizeVec2 {
906
    #[inline]
907
    fn mul_assign(&mut self, rhs: &usize) {
3✔
908
        self.mul_assign(*rhs);
3✔
909
    }
910
}
911

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

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

931
impl Mul<&USizeVec2> for &usize {
932
    type Output = USizeVec2;
933
    #[inline]
934
    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
935
        (*self).mul(*rhs)
3✔
936
    }
937
}
938

939
impl Mul<USizeVec2> for &usize {
940
    type Output = USizeVec2;
941
    #[inline]
942
    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
3✔
943
        (*self).mul(rhs)
3✔
944
    }
945
}
946

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

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

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

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

982
impl AddAssign for USizeVec2 {
983
    #[inline]
984
    fn add_assign(&mut self, rhs: Self) {
3✔
985
        self.x.add_assign(rhs.x);
3✔
986
        self.y.add_assign(rhs.y);
5✔
987
    }
988
}
989

990
impl AddAssign<&Self> for USizeVec2 {
991
    #[inline]
992
    fn add_assign(&mut self, rhs: &Self) {
3✔
993
        self.add_assign(*rhs);
3✔
994
    }
995
}
996

997
impl Add<usize> for USizeVec2 {
998
    type Output = Self;
999
    #[inline]
1000
    fn add(self, rhs: usize) -> Self {
3✔
1001
        Self {
1002
            x: self.x.add(rhs),
3✔
1003
            y: self.y.add(rhs),
3✔
1004
        }
1005
    }
1006
}
1007

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

1016
impl Add<&usize> for &USizeVec2 {
1017
    type Output = USizeVec2;
1018
    #[inline]
1019
    fn add(self, rhs: &usize) -> USizeVec2 {
3✔
1020
        (*self).add(*rhs)
3✔
1021
    }
1022
}
1023

1024
impl Add<usize> for &USizeVec2 {
1025
    type Output = USizeVec2;
1026
    #[inline]
1027
    fn add(self, rhs: usize) -> USizeVec2 {
3✔
1028
        (*self).add(rhs)
3✔
1029
    }
1030
}
1031

1032
impl AddAssign<usize> for USizeVec2 {
1033
    #[inline]
1034
    fn add_assign(&mut self, rhs: usize) {
3✔
1035
        self.x.add_assign(rhs);
3✔
1036
        self.y.add_assign(rhs);
3✔
1037
    }
1038
}
1039

1040
impl AddAssign<&usize> for USizeVec2 {
1041
    #[inline]
1042
    fn add_assign(&mut self, rhs: &usize) {
3✔
1043
        self.add_assign(*rhs);
3✔
1044
    }
1045
}
1046

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

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

1066
impl Add<&USizeVec2> for &usize {
1067
    type Output = USizeVec2;
1068
    #[inline]
1069
    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1070
        (*self).add(*rhs)
3✔
1071
    }
1072
}
1073

1074
impl Add<USizeVec2> for &usize {
1075
    type Output = USizeVec2;
1076
    #[inline]
1077
    fn add(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1078
        (*self).add(rhs)
3✔
1079
    }
1080
}
1081

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

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

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

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

1117
impl SubAssign for USizeVec2 {
1118
    #[inline]
1119
    fn sub_assign(&mut self, rhs: Self) {
3✔
1120
        self.x.sub_assign(rhs.x);
3✔
1121
        self.y.sub_assign(rhs.y);
5✔
1122
    }
1123
}
1124

1125
impl SubAssign<&Self> for USizeVec2 {
1126
    #[inline]
1127
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1128
        self.sub_assign(*rhs);
3✔
1129
    }
1130
}
1131

1132
impl Sub<usize> for USizeVec2 {
1133
    type Output = Self;
1134
    #[inline]
1135
    fn sub(self, rhs: usize) -> Self {
5✔
1136
        Self {
1137
            x: self.x.sub(rhs),
5✔
1138
            y: self.y.sub(rhs),
5✔
1139
        }
1140
    }
1141
}
1142

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

1151
impl Sub<&usize> for &USizeVec2 {
1152
    type Output = USizeVec2;
1153
    #[inline]
1154
    fn sub(self, rhs: &usize) -> USizeVec2 {
3✔
1155
        (*self).sub(*rhs)
3✔
1156
    }
1157
}
1158

1159
impl Sub<usize> for &USizeVec2 {
1160
    type Output = USizeVec2;
1161
    #[inline]
1162
    fn sub(self, rhs: usize) -> USizeVec2 {
3✔
1163
        (*self).sub(rhs)
3✔
1164
    }
1165
}
1166

1167
impl SubAssign<usize> for USizeVec2 {
1168
    #[inline]
1169
    fn sub_assign(&mut self, rhs: usize) {
3✔
1170
        self.x.sub_assign(rhs);
3✔
1171
        self.y.sub_assign(rhs);
3✔
1172
    }
1173
}
1174

1175
impl SubAssign<&usize> for USizeVec2 {
1176
    #[inline]
1177
    fn sub_assign(&mut self, rhs: &usize) {
3✔
1178
        self.sub_assign(*rhs);
3✔
1179
    }
1180
}
1181

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

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

1201
impl Sub<&USizeVec2> for &usize {
1202
    type Output = USizeVec2;
1203
    #[inline]
1204
    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1205
        (*self).sub(*rhs)
3✔
1206
    }
1207
}
1208

1209
impl Sub<USizeVec2> for &usize {
1210
    type Output = USizeVec2;
1211
    #[inline]
1212
    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1213
        (*self).sub(rhs)
3✔
1214
    }
1215
}
1216

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

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

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

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

1252
impl RemAssign for USizeVec2 {
1253
    #[inline]
1254
    fn rem_assign(&mut self, rhs: Self) {
3✔
1255
        self.x.rem_assign(rhs.x);
4✔
1256
        self.y.rem_assign(rhs.y);
4✔
1257
    }
1258
}
1259

1260
impl RemAssign<&Self> for USizeVec2 {
1261
    #[inline]
1262
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1263
        self.rem_assign(*rhs);
3✔
1264
    }
1265
}
1266

1267
impl Rem<usize> for USizeVec2 {
1268
    type Output = Self;
1269
    #[inline]
1270
    fn rem(self, rhs: usize) -> Self {
3✔
1271
        Self {
1272
            x: self.x.rem(rhs),
3✔
1273
            y: self.y.rem(rhs),
3✔
1274
        }
1275
    }
1276
}
1277

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

1286
impl Rem<&usize> for &USizeVec2 {
1287
    type Output = USizeVec2;
1288
    #[inline]
1289
    fn rem(self, rhs: &usize) -> USizeVec2 {
3✔
1290
        (*self).rem(*rhs)
3✔
1291
    }
1292
}
1293

1294
impl Rem<usize> for &USizeVec2 {
1295
    type Output = USizeVec2;
1296
    #[inline]
1297
    fn rem(self, rhs: usize) -> USizeVec2 {
3✔
1298
        (*self).rem(rhs)
3✔
1299
    }
1300
}
1301

1302
impl RemAssign<usize> for USizeVec2 {
1303
    #[inline]
1304
    fn rem_assign(&mut self, rhs: usize) {
3✔
1305
        self.x.rem_assign(rhs);
3✔
1306
        self.y.rem_assign(rhs);
4✔
1307
    }
1308
}
1309

1310
impl RemAssign<&usize> for USizeVec2 {
1311
    #[inline]
1312
    fn rem_assign(&mut self, rhs: &usize) {
3✔
1313
        self.rem_assign(*rhs);
3✔
1314
    }
1315
}
1316

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

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

1336
impl Rem<&USizeVec2> for &usize {
1337
    type Output = USizeVec2;
1338
    #[inline]
1339
    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1340
        (*self).rem(*rhs)
3✔
1341
    }
1342
}
1343

1344
impl Rem<USizeVec2> for &usize {
1345
    type Output = USizeVec2;
1346
    #[inline]
1347
    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1348
        (*self).rem(rhs)
3✔
1349
    }
1350
}
1351

1352
impl AsRef<[usize; 2]> for USizeVec2 {
1353
    #[inline]
1354
    fn as_ref(&self) -> &[usize; 2] {
3✔
1355
        unsafe { &*(self as *const Self as *const [usize; 2]) }
3✔
1356
    }
1357
}
1358

1359
impl AsMut<[usize; 2]> for USizeVec2 {
1360
    #[inline]
1361
    fn as_mut(&mut self) -> &mut [usize; 2] {
3✔
1362
        unsafe { &mut *(self as *mut Self as *mut [usize; 2]) }
3✔
1363
    }
1364
}
1365

1366
impl Sum for USizeVec2 {
1367
    #[inline]
1368
    fn sum<I>(iter: I) -> Self
3✔
1369
    where
1370
        I: Iterator<Item = Self>,
1371
    {
1372
        iter.fold(Self::ZERO, Self::add)
3✔
1373
    }
1374
}
1375

1376
impl<'a> Sum<&'a Self> for USizeVec2 {
1377
    #[inline]
1378
    fn sum<I>(iter: I) -> Self
3✔
1379
    where
1380
        I: Iterator<Item = &'a Self>,
1381
    {
1382
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1383
    }
1384
}
1385

1386
impl Product for USizeVec2 {
1387
    #[inline]
1388
    fn product<I>(iter: I) -> Self
3✔
1389
    where
1390
        I: Iterator<Item = Self>,
1391
    {
1392
        iter.fold(Self::ONE, Self::mul)
3✔
1393
    }
1394
}
1395

1396
impl<'a> Product<&'a Self> for USizeVec2 {
1397
    #[inline]
1398
    fn product<I>(iter: I) -> Self
3✔
1399
    where
1400
        I: Iterator<Item = &'a Self>,
1401
    {
1402
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1403
    }
1404
}
1405

1406
impl Not for USizeVec2 {
1407
    type Output = Self;
1408
    #[inline]
1409
    fn not(self) -> Self {
3✔
1410
        Self {
1411
            x: self.x.not(),
3✔
1412
            y: self.y.not(),
3✔
1413
        }
1414
    }
1415
}
1416

1417
impl Not for &USizeVec2 {
1418
    type Output = USizeVec2;
1419
    #[inline]
1420
    fn not(self) -> USizeVec2 {
3✔
1421
        (*self).not()
3✔
1422
    }
1423
}
1424

1425
impl BitAnd for USizeVec2 {
1426
    type Output = Self;
1427
    #[inline]
1428
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1429
        Self {
1430
            x: self.x.bitand(rhs.x),
3✔
1431
            y: self.y.bitand(rhs.y),
3✔
1432
        }
1433
    }
1434
}
1435

1436
impl BitAnd<&Self> for USizeVec2 {
1437
    type Output = Self;
1438
    #[inline]
1439
    fn bitand(self, rhs: &Self) -> Self {
3✔
1440
        self.bitand(*rhs)
3✔
1441
    }
1442
}
1443

1444
impl BitAnd<&USizeVec2> for &USizeVec2 {
1445
    type Output = USizeVec2;
1446
    #[inline]
1447
    fn bitand(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1448
        (*self).bitand(*rhs)
3✔
1449
    }
1450
}
1451

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

1460
impl BitAndAssign for USizeVec2 {
1461
    #[inline]
1462
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1463
        *self = self.bitand(rhs);
3✔
1464
    }
1465
}
1466

1467
impl BitAndAssign<&Self> for USizeVec2 {
1468
    #[inline]
1469
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1470
        self.bitand_assign(*rhs);
3✔
1471
    }
1472
}
1473

1474
impl BitOr for USizeVec2 {
1475
    type Output = Self;
1476
    #[inline]
1477
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1478
        Self {
1479
            x: self.x.bitor(rhs.x),
3✔
1480
            y: self.y.bitor(rhs.y),
3✔
1481
        }
1482
    }
1483
}
1484

1485
impl BitOr<&Self> for USizeVec2 {
1486
    type Output = Self;
1487
    #[inline]
1488
    fn bitor(self, rhs: &Self) -> Self {
3✔
1489
        self.bitor(*rhs)
3✔
1490
    }
1491
}
1492

1493
impl BitOr<&USizeVec2> for &USizeVec2 {
1494
    type Output = USizeVec2;
1495
    #[inline]
1496
    fn bitor(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1497
        (*self).bitor(*rhs)
3✔
1498
    }
1499
}
1500

1501
impl BitOr<USizeVec2> for &USizeVec2 {
1502
    type Output = USizeVec2;
1503
    #[inline]
1504
    fn bitor(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1505
        (*self).bitor(rhs)
3✔
1506
    }
1507
}
1508

1509
impl BitOrAssign for USizeVec2 {
1510
    #[inline]
1511
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1512
        *self = self.bitor(rhs);
3✔
1513
    }
1514
}
1515

1516
impl BitOrAssign<&Self> for USizeVec2 {
1517
    #[inline]
1518
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1519
        self.bitor_assign(*rhs);
3✔
1520
    }
1521
}
1522

1523
impl BitXor for USizeVec2 {
1524
    type Output = Self;
1525
    #[inline]
1526
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1527
        Self {
1528
            x: self.x.bitxor(rhs.x),
3✔
1529
            y: self.y.bitxor(rhs.y),
3✔
1530
        }
1531
    }
1532
}
1533

1534
impl BitXor<&Self> for USizeVec2 {
1535
    type Output = Self;
1536
    #[inline]
1537
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1538
        self.bitxor(*rhs)
3✔
1539
    }
1540
}
1541

1542
impl BitXor<&USizeVec2> for &USizeVec2 {
1543
    type Output = USizeVec2;
1544
    #[inline]
1545
    fn bitxor(self, rhs: &USizeVec2) -> USizeVec2 {
3✔
1546
        (*self).bitxor(*rhs)
3✔
1547
    }
1548
}
1549

1550
impl BitXor<USizeVec2> for &USizeVec2 {
1551
    type Output = USizeVec2;
1552
    #[inline]
1553
    fn bitxor(self, rhs: USizeVec2) -> USizeVec2 {
3✔
1554
        (*self).bitxor(rhs)
3✔
1555
    }
1556
}
1557

1558
impl BitXorAssign for USizeVec2 {
1559
    #[inline]
1560
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1561
        *self = self.bitxor(rhs);
3✔
1562
    }
1563
}
1564

1565
impl BitXorAssign<&Self> for USizeVec2 {
1566
    #[inline]
1567
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1568
        self.bitxor_assign(*rhs);
3✔
1569
    }
1570
}
1571

1572
impl BitAnd<usize> for USizeVec2 {
1573
    type Output = Self;
1574
    #[inline]
1575
    fn bitand(self, rhs: usize) -> Self::Output {
3✔
1576
        Self {
1577
            x: self.x.bitand(rhs),
3✔
1578
            y: self.y.bitand(rhs),
3✔
1579
        }
1580
    }
1581
}
1582

1583
impl BitAnd<&usize> for USizeVec2 {
1584
    type Output = Self;
1585
    #[inline]
1586
    fn bitand(self, rhs: &usize) -> Self {
3✔
1587
        self.bitand(*rhs)
3✔
1588
    }
1589
}
1590

1591
impl BitAnd<&usize> for &USizeVec2 {
1592
    type Output = USizeVec2;
1593
    #[inline]
1594
    fn bitand(self, rhs: &usize) -> USizeVec2 {
3✔
1595
        (*self).bitand(*rhs)
3✔
1596
    }
1597
}
1598

1599
impl BitAnd<usize> for &USizeVec2 {
1600
    type Output = USizeVec2;
1601
    #[inline]
1602
    fn bitand(self, rhs: usize) -> USizeVec2 {
3✔
1603
        (*self).bitand(rhs)
3✔
1604
    }
1605
}
1606

1607
impl BitAndAssign<usize> for USizeVec2 {
1608
    #[inline]
1609
    fn bitand_assign(&mut self, rhs: usize) {
3✔
1610
        *self = self.bitand(rhs);
3✔
1611
    }
1612
}
1613

1614
impl BitAndAssign<&usize> for USizeVec2 {
1615
    #[inline]
1616
    fn bitand_assign(&mut self, rhs: &usize) {
3✔
1617
        self.bitand_assign(*rhs);
3✔
1618
    }
1619
}
1620

1621
impl BitOr<usize> for USizeVec2 {
1622
    type Output = Self;
1623
    #[inline]
1624
    fn bitor(self, rhs: usize) -> Self::Output {
3✔
1625
        Self {
1626
            x: self.x.bitor(rhs),
3✔
1627
            y: self.y.bitor(rhs),
3✔
1628
        }
1629
    }
1630
}
1631

1632
impl BitOr<&usize> for USizeVec2 {
1633
    type Output = Self;
1634
    #[inline]
1635
    fn bitor(self, rhs: &usize) -> Self {
3✔
1636
        self.bitor(*rhs)
3✔
1637
    }
1638
}
1639

1640
impl BitOr<&usize> for &USizeVec2 {
1641
    type Output = USizeVec2;
1642
    #[inline]
1643
    fn bitor(self, rhs: &usize) -> USizeVec2 {
3✔
1644
        (*self).bitor(*rhs)
3✔
1645
    }
1646
}
1647

1648
impl BitOr<usize> for &USizeVec2 {
1649
    type Output = USizeVec2;
1650
    #[inline]
1651
    fn bitor(self, rhs: usize) -> USizeVec2 {
3✔
1652
        (*self).bitor(rhs)
3✔
1653
    }
1654
}
1655

1656
impl BitOrAssign<usize> for USizeVec2 {
1657
    #[inline]
1658
    fn bitor_assign(&mut self, rhs: usize) {
3✔
1659
        *self = self.bitor(rhs);
3✔
1660
    }
1661
}
1662

1663
impl BitOrAssign<&usize> for USizeVec2 {
1664
    #[inline]
1665
    fn bitor_assign(&mut self, rhs: &usize) {
3✔
1666
        self.bitor_assign(*rhs);
3✔
1667
    }
1668
}
1669

1670
impl BitXor<usize> for USizeVec2 {
1671
    type Output = Self;
1672
    #[inline]
1673
    fn bitxor(self, rhs: usize) -> Self::Output {
3✔
1674
        Self {
1675
            x: self.x.bitxor(rhs),
3✔
1676
            y: self.y.bitxor(rhs),
3✔
1677
        }
1678
    }
1679
}
1680

1681
impl BitXor<&usize> for USizeVec2 {
1682
    type Output = Self;
1683
    #[inline]
1684
    fn bitxor(self, rhs: &usize) -> Self {
3✔
1685
        self.bitxor(*rhs)
3✔
1686
    }
1687
}
1688

1689
impl BitXor<&usize> for &USizeVec2 {
1690
    type Output = USizeVec2;
1691
    #[inline]
1692
    fn bitxor(self, rhs: &usize) -> USizeVec2 {
3✔
1693
        (*self).bitxor(*rhs)
3✔
1694
    }
1695
}
1696

1697
impl BitXor<usize> for &USizeVec2 {
1698
    type Output = USizeVec2;
1699
    #[inline]
1700
    fn bitxor(self, rhs: usize) -> USizeVec2 {
3✔
1701
        (*self).bitxor(rhs)
3✔
1702
    }
1703
}
1704

1705
impl BitXorAssign<usize> for USizeVec2 {
1706
    #[inline]
1707
    fn bitxor_assign(&mut self, rhs: usize) {
3✔
1708
        *self = self.bitxor(rhs);
3✔
1709
    }
1710
}
1711

1712
impl BitXorAssign<&usize> for USizeVec2 {
1713
    #[inline]
1714
    fn bitxor_assign(&mut self, rhs: &usize) {
3✔
1715
        self.bitxor_assign(*rhs);
3✔
1716
    }
1717
}
1718

1719
impl Shl<i8> for USizeVec2 {
1720
    type Output = Self;
1721
    #[inline]
1722
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1723
        Self {
1724
            x: self.x.shl(rhs),
3✔
1725
            y: self.y.shl(rhs),
3✔
1726
        }
1727
    }
1728
}
1729

1730
impl Shl<&i8> for USizeVec2 {
1731
    type Output = Self;
1732
    #[inline]
1733
    fn shl(self, rhs: &i8) -> Self {
3✔
1734
        self.shl(*rhs)
3✔
1735
    }
1736
}
1737

1738
impl Shl<&i8> for &USizeVec2 {
1739
    type Output = USizeVec2;
1740
    #[inline]
1741
    fn shl(self, rhs: &i8) -> USizeVec2 {
3✔
1742
        (*self).shl(*rhs)
3✔
1743
    }
1744
}
1745

1746
impl Shl<i8> for &USizeVec2 {
1747
    type Output = USizeVec2;
1748
    #[inline]
1749
    fn shl(self, rhs: i8) -> USizeVec2 {
3✔
1750
        (*self).shl(rhs)
3✔
1751
    }
1752
}
1753

1754
impl ShlAssign<i8> for USizeVec2 {
1755
    #[inline]
1756
    fn shl_assign(&mut self, rhs: i8) {
3✔
1757
        *self = self.shl(rhs);
3✔
1758
    }
1759
}
1760

1761
impl ShlAssign<&i8> for USizeVec2 {
1762
    #[inline]
1763
    fn shl_assign(&mut self, rhs: &i8) {
3✔
1764
        self.shl_assign(*rhs);
3✔
1765
    }
1766
}
1767

1768
impl Shr<i8> for USizeVec2 {
1769
    type Output = Self;
1770
    #[inline]
1771
    fn shr(self, rhs: i8) -> Self::Output {
3✔
1772
        Self {
1773
            x: self.x.shr(rhs),
3✔
1774
            y: self.y.shr(rhs),
3✔
1775
        }
1776
    }
1777
}
1778

1779
impl Shr<&i8> for USizeVec2 {
1780
    type Output = Self;
1781
    #[inline]
1782
    fn shr(self, rhs: &i8) -> Self {
3✔
1783
        self.shr(*rhs)
3✔
1784
    }
1785
}
1786

1787
impl Shr<&i8> for &USizeVec2 {
1788
    type Output = USizeVec2;
1789
    #[inline]
1790
    fn shr(self, rhs: &i8) -> USizeVec2 {
3✔
1791
        (*self).shr(*rhs)
3✔
1792
    }
1793
}
1794

1795
impl Shr<i8> for &USizeVec2 {
1796
    type Output = USizeVec2;
1797
    #[inline]
1798
    fn shr(self, rhs: i8) -> USizeVec2 {
3✔
1799
        (*self).shr(rhs)
3✔
1800
    }
1801
}
1802

1803
impl ShrAssign<i8> for USizeVec2 {
1804
    #[inline]
1805
    fn shr_assign(&mut self, rhs: i8) {
3✔
1806
        *self = self.shr(rhs);
3✔
1807
    }
1808
}
1809

1810
impl ShrAssign<&i8> for USizeVec2 {
1811
    #[inline]
1812
    fn shr_assign(&mut self, rhs: &i8) {
3✔
1813
        self.shr_assign(*rhs);
3✔
1814
    }
1815
}
1816

1817
impl Shl<i16> for USizeVec2 {
1818
    type Output = Self;
1819
    #[inline]
1820
    fn shl(self, rhs: i16) -> Self::Output {
3✔
1821
        Self {
1822
            x: self.x.shl(rhs),
3✔
1823
            y: self.y.shl(rhs),
3✔
1824
        }
1825
    }
1826
}
1827

1828
impl Shl<&i16> for USizeVec2 {
1829
    type Output = Self;
1830
    #[inline]
1831
    fn shl(self, rhs: &i16) -> Self {
3✔
1832
        self.shl(*rhs)
3✔
1833
    }
1834
}
1835

1836
impl Shl<&i16> for &USizeVec2 {
1837
    type Output = USizeVec2;
1838
    #[inline]
1839
    fn shl(self, rhs: &i16) -> USizeVec2 {
3✔
1840
        (*self).shl(*rhs)
3✔
1841
    }
1842
}
1843

1844
impl Shl<i16> for &USizeVec2 {
1845
    type Output = USizeVec2;
1846
    #[inline]
1847
    fn shl(self, rhs: i16) -> USizeVec2 {
3✔
1848
        (*self).shl(rhs)
3✔
1849
    }
1850
}
1851

1852
impl ShlAssign<i16> for USizeVec2 {
1853
    #[inline]
1854
    fn shl_assign(&mut self, rhs: i16) {
3✔
1855
        *self = self.shl(rhs);
3✔
1856
    }
1857
}
1858

1859
impl ShlAssign<&i16> for USizeVec2 {
1860
    #[inline]
1861
    fn shl_assign(&mut self, rhs: &i16) {
3✔
1862
        self.shl_assign(*rhs);
3✔
1863
    }
1864
}
1865

1866
impl Shr<i16> for USizeVec2 {
1867
    type Output = Self;
1868
    #[inline]
1869
    fn shr(self, rhs: i16) -> Self::Output {
3✔
1870
        Self {
1871
            x: self.x.shr(rhs),
3✔
1872
            y: self.y.shr(rhs),
3✔
1873
        }
1874
    }
1875
}
1876

1877
impl Shr<&i16> for USizeVec2 {
1878
    type Output = Self;
1879
    #[inline]
1880
    fn shr(self, rhs: &i16) -> Self {
3✔
1881
        self.shr(*rhs)
3✔
1882
    }
1883
}
1884

1885
impl Shr<&i16> for &USizeVec2 {
1886
    type Output = USizeVec2;
1887
    #[inline]
1888
    fn shr(self, rhs: &i16) -> USizeVec2 {
3✔
1889
        (*self).shr(*rhs)
3✔
1890
    }
1891
}
1892

1893
impl Shr<i16> for &USizeVec2 {
1894
    type Output = USizeVec2;
1895
    #[inline]
1896
    fn shr(self, rhs: i16) -> USizeVec2 {
3✔
1897
        (*self).shr(rhs)
3✔
1898
    }
1899
}
1900

1901
impl ShrAssign<i16> for USizeVec2 {
1902
    #[inline]
1903
    fn shr_assign(&mut self, rhs: i16) {
3✔
1904
        *self = self.shr(rhs);
3✔
1905
    }
1906
}
1907

1908
impl ShrAssign<&i16> for USizeVec2 {
1909
    #[inline]
1910
    fn shr_assign(&mut self, rhs: &i16) {
3✔
1911
        self.shr_assign(*rhs);
3✔
1912
    }
1913
}
1914

1915
impl Shl<i32> for USizeVec2 {
1916
    type Output = Self;
1917
    #[inline]
1918
    fn shl(self, rhs: i32) -> Self::Output {
3✔
1919
        Self {
1920
            x: self.x.shl(rhs),
3✔
1921
            y: self.y.shl(rhs),
3✔
1922
        }
1923
    }
1924
}
1925

1926
impl Shl<&i32> for USizeVec2 {
1927
    type Output = Self;
1928
    #[inline]
1929
    fn shl(self, rhs: &i32) -> Self {
3✔
1930
        self.shl(*rhs)
3✔
1931
    }
1932
}
1933

1934
impl Shl<&i32> for &USizeVec2 {
1935
    type Output = USizeVec2;
1936
    #[inline]
1937
    fn shl(self, rhs: &i32) -> USizeVec2 {
3✔
1938
        (*self).shl(*rhs)
3✔
1939
    }
1940
}
1941

1942
impl Shl<i32> for &USizeVec2 {
1943
    type Output = USizeVec2;
1944
    #[inline]
1945
    fn shl(self, rhs: i32) -> USizeVec2 {
3✔
1946
        (*self).shl(rhs)
3✔
1947
    }
1948
}
1949

1950
impl ShlAssign<i32> for USizeVec2 {
1951
    #[inline]
1952
    fn shl_assign(&mut self, rhs: i32) {
3✔
1953
        *self = self.shl(rhs);
3✔
1954
    }
1955
}
1956

1957
impl ShlAssign<&i32> for USizeVec2 {
1958
    #[inline]
1959
    fn shl_assign(&mut self, rhs: &i32) {
3✔
1960
        self.shl_assign(*rhs);
3✔
1961
    }
1962
}
1963

1964
impl Shr<i32> for USizeVec2 {
1965
    type Output = Self;
1966
    #[inline]
1967
    fn shr(self, rhs: i32) -> Self::Output {
3✔
1968
        Self {
1969
            x: self.x.shr(rhs),
3✔
1970
            y: self.y.shr(rhs),
3✔
1971
        }
1972
    }
1973
}
1974

1975
impl Shr<&i32> for USizeVec2 {
1976
    type Output = Self;
1977
    #[inline]
1978
    fn shr(self, rhs: &i32) -> Self {
3✔
1979
        self.shr(*rhs)
3✔
1980
    }
1981
}
1982

1983
impl Shr<&i32> for &USizeVec2 {
1984
    type Output = USizeVec2;
1985
    #[inline]
1986
    fn shr(self, rhs: &i32) -> USizeVec2 {
3✔
1987
        (*self).shr(*rhs)
3✔
1988
    }
1989
}
1990

1991
impl Shr<i32> for &USizeVec2 {
1992
    type Output = USizeVec2;
1993
    #[inline]
1994
    fn shr(self, rhs: i32) -> USizeVec2 {
3✔
1995
        (*self).shr(rhs)
3✔
1996
    }
1997
}
1998

1999
impl ShrAssign<i32> for USizeVec2 {
2000
    #[inline]
2001
    fn shr_assign(&mut self, rhs: i32) {
3✔
2002
        *self = self.shr(rhs);
3✔
2003
    }
2004
}
2005

2006
impl ShrAssign<&i32> for USizeVec2 {
2007
    #[inline]
2008
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2009
        self.shr_assign(*rhs);
3✔
2010
    }
2011
}
2012

2013
impl Shl<i64> for USizeVec2 {
2014
    type Output = Self;
2015
    #[inline]
2016
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2017
        Self {
2018
            x: self.x.shl(rhs),
3✔
2019
            y: self.y.shl(rhs),
3✔
2020
        }
2021
    }
2022
}
2023

2024
impl Shl<&i64> for USizeVec2 {
2025
    type Output = Self;
2026
    #[inline]
2027
    fn shl(self, rhs: &i64) -> Self {
3✔
2028
        self.shl(*rhs)
3✔
2029
    }
2030
}
2031

2032
impl Shl<&i64> for &USizeVec2 {
2033
    type Output = USizeVec2;
2034
    #[inline]
2035
    fn shl(self, rhs: &i64) -> USizeVec2 {
3✔
2036
        (*self).shl(*rhs)
3✔
2037
    }
2038
}
2039

2040
impl Shl<i64> for &USizeVec2 {
2041
    type Output = USizeVec2;
2042
    #[inline]
2043
    fn shl(self, rhs: i64) -> USizeVec2 {
3✔
2044
        (*self).shl(rhs)
3✔
2045
    }
2046
}
2047

2048
impl ShlAssign<i64> for USizeVec2 {
2049
    #[inline]
2050
    fn shl_assign(&mut self, rhs: i64) {
3✔
2051
        *self = self.shl(rhs);
3✔
2052
    }
2053
}
2054

2055
impl ShlAssign<&i64> for USizeVec2 {
2056
    #[inline]
2057
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2058
        self.shl_assign(*rhs);
3✔
2059
    }
2060
}
2061

2062
impl Shr<i64> for USizeVec2 {
2063
    type Output = Self;
2064
    #[inline]
2065
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2066
        Self {
2067
            x: self.x.shr(rhs),
3✔
2068
            y: self.y.shr(rhs),
3✔
2069
        }
2070
    }
2071
}
2072

2073
impl Shr<&i64> for USizeVec2 {
2074
    type Output = Self;
2075
    #[inline]
2076
    fn shr(self, rhs: &i64) -> Self {
3✔
2077
        self.shr(*rhs)
3✔
2078
    }
2079
}
2080

2081
impl Shr<&i64> for &USizeVec2 {
2082
    type Output = USizeVec2;
2083
    #[inline]
2084
    fn shr(self, rhs: &i64) -> USizeVec2 {
3✔
2085
        (*self).shr(*rhs)
3✔
2086
    }
2087
}
2088

2089
impl Shr<i64> for &USizeVec2 {
2090
    type Output = USizeVec2;
2091
    #[inline]
2092
    fn shr(self, rhs: i64) -> USizeVec2 {
3✔
2093
        (*self).shr(rhs)
3✔
2094
    }
2095
}
2096

2097
impl ShrAssign<i64> for USizeVec2 {
2098
    #[inline]
2099
    fn shr_assign(&mut self, rhs: i64) {
3✔
2100
        *self = self.shr(rhs);
3✔
2101
    }
2102
}
2103

2104
impl ShrAssign<&i64> for USizeVec2 {
2105
    #[inline]
2106
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2107
        self.shr_assign(*rhs);
3✔
2108
    }
2109
}
2110

2111
impl Shl<u8> for USizeVec2 {
2112
    type Output = Self;
2113
    #[inline]
2114
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2115
        Self {
2116
            x: self.x.shl(rhs),
3✔
2117
            y: self.y.shl(rhs),
3✔
2118
        }
2119
    }
2120
}
2121

2122
impl Shl<&u8> for USizeVec2 {
2123
    type Output = Self;
2124
    #[inline]
2125
    fn shl(self, rhs: &u8) -> Self {
3✔
2126
        self.shl(*rhs)
3✔
2127
    }
2128
}
2129

2130
impl Shl<&u8> for &USizeVec2 {
2131
    type Output = USizeVec2;
2132
    #[inline]
2133
    fn shl(self, rhs: &u8) -> USizeVec2 {
3✔
2134
        (*self).shl(*rhs)
3✔
2135
    }
2136
}
2137

2138
impl Shl<u8> for &USizeVec2 {
2139
    type Output = USizeVec2;
2140
    #[inline]
2141
    fn shl(self, rhs: u8) -> USizeVec2 {
3✔
2142
        (*self).shl(rhs)
3✔
2143
    }
2144
}
2145

2146
impl ShlAssign<u8> for USizeVec2 {
2147
    #[inline]
2148
    fn shl_assign(&mut self, rhs: u8) {
3✔
2149
        *self = self.shl(rhs);
3✔
2150
    }
2151
}
2152

2153
impl ShlAssign<&u8> for USizeVec2 {
2154
    #[inline]
2155
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2156
        self.shl_assign(*rhs);
3✔
2157
    }
2158
}
2159

2160
impl Shr<u8> for USizeVec2 {
2161
    type Output = Self;
2162
    #[inline]
2163
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2164
        Self {
2165
            x: self.x.shr(rhs),
3✔
2166
            y: self.y.shr(rhs),
3✔
2167
        }
2168
    }
2169
}
2170

2171
impl Shr<&u8> for USizeVec2 {
2172
    type Output = Self;
2173
    #[inline]
2174
    fn shr(self, rhs: &u8) -> Self {
3✔
2175
        self.shr(*rhs)
3✔
2176
    }
2177
}
2178

2179
impl Shr<&u8> for &USizeVec2 {
2180
    type Output = USizeVec2;
2181
    #[inline]
2182
    fn shr(self, rhs: &u8) -> USizeVec2 {
3✔
2183
        (*self).shr(*rhs)
3✔
2184
    }
2185
}
2186

2187
impl Shr<u8> for &USizeVec2 {
2188
    type Output = USizeVec2;
2189
    #[inline]
2190
    fn shr(self, rhs: u8) -> USizeVec2 {
3✔
2191
        (*self).shr(rhs)
3✔
2192
    }
2193
}
2194

2195
impl ShrAssign<u8> for USizeVec2 {
2196
    #[inline]
2197
    fn shr_assign(&mut self, rhs: u8) {
3✔
2198
        *self = self.shr(rhs);
3✔
2199
    }
2200
}
2201

2202
impl ShrAssign<&u8> for USizeVec2 {
2203
    #[inline]
2204
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2205
        self.shr_assign(*rhs);
3✔
2206
    }
2207
}
2208

2209
impl Shl<u16> for USizeVec2 {
2210
    type Output = Self;
2211
    #[inline]
2212
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2213
        Self {
2214
            x: self.x.shl(rhs),
3✔
2215
            y: self.y.shl(rhs),
3✔
2216
        }
2217
    }
2218
}
2219

2220
impl Shl<&u16> for USizeVec2 {
2221
    type Output = Self;
2222
    #[inline]
2223
    fn shl(self, rhs: &u16) -> Self {
3✔
2224
        self.shl(*rhs)
3✔
2225
    }
2226
}
2227

2228
impl Shl<&u16> for &USizeVec2 {
2229
    type Output = USizeVec2;
2230
    #[inline]
2231
    fn shl(self, rhs: &u16) -> USizeVec2 {
3✔
2232
        (*self).shl(*rhs)
3✔
2233
    }
2234
}
2235

2236
impl Shl<u16> for &USizeVec2 {
2237
    type Output = USizeVec2;
2238
    #[inline]
2239
    fn shl(self, rhs: u16) -> USizeVec2 {
3✔
2240
        (*self).shl(rhs)
3✔
2241
    }
2242
}
2243

2244
impl ShlAssign<u16> for USizeVec2 {
2245
    #[inline]
2246
    fn shl_assign(&mut self, rhs: u16) {
3✔
2247
        *self = self.shl(rhs);
3✔
2248
    }
2249
}
2250

2251
impl ShlAssign<&u16> for USizeVec2 {
2252
    #[inline]
2253
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2254
        self.shl_assign(*rhs);
3✔
2255
    }
2256
}
2257

2258
impl Shr<u16> for USizeVec2 {
2259
    type Output = Self;
2260
    #[inline]
2261
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2262
        Self {
2263
            x: self.x.shr(rhs),
3✔
2264
            y: self.y.shr(rhs),
3✔
2265
        }
2266
    }
2267
}
2268

2269
impl Shr<&u16> for USizeVec2 {
2270
    type Output = Self;
2271
    #[inline]
2272
    fn shr(self, rhs: &u16) -> Self {
3✔
2273
        self.shr(*rhs)
3✔
2274
    }
2275
}
2276

2277
impl Shr<&u16> for &USizeVec2 {
2278
    type Output = USizeVec2;
2279
    #[inline]
2280
    fn shr(self, rhs: &u16) -> USizeVec2 {
3✔
2281
        (*self).shr(*rhs)
3✔
2282
    }
2283
}
2284

2285
impl Shr<u16> for &USizeVec2 {
2286
    type Output = USizeVec2;
2287
    #[inline]
2288
    fn shr(self, rhs: u16) -> USizeVec2 {
3✔
2289
        (*self).shr(rhs)
3✔
2290
    }
2291
}
2292

2293
impl ShrAssign<u16> for USizeVec2 {
2294
    #[inline]
2295
    fn shr_assign(&mut self, rhs: u16) {
3✔
2296
        *self = self.shr(rhs);
3✔
2297
    }
2298
}
2299

2300
impl ShrAssign<&u16> for USizeVec2 {
2301
    #[inline]
2302
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2303
        self.shr_assign(*rhs);
3✔
2304
    }
2305
}
2306

2307
impl Shl<u32> for USizeVec2 {
2308
    type Output = Self;
2309
    #[inline]
2310
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2311
        Self {
2312
            x: self.x.shl(rhs),
3✔
2313
            y: self.y.shl(rhs),
3✔
2314
        }
2315
    }
2316
}
2317

2318
impl Shl<&u32> for USizeVec2 {
2319
    type Output = Self;
2320
    #[inline]
2321
    fn shl(self, rhs: &u32) -> Self {
3✔
2322
        self.shl(*rhs)
3✔
2323
    }
2324
}
2325

2326
impl Shl<&u32> for &USizeVec2 {
2327
    type Output = USizeVec2;
2328
    #[inline]
2329
    fn shl(self, rhs: &u32) -> USizeVec2 {
3✔
2330
        (*self).shl(*rhs)
3✔
2331
    }
2332
}
2333

2334
impl Shl<u32> for &USizeVec2 {
2335
    type Output = USizeVec2;
2336
    #[inline]
2337
    fn shl(self, rhs: u32) -> USizeVec2 {
3✔
2338
        (*self).shl(rhs)
3✔
2339
    }
2340
}
2341

2342
impl ShlAssign<u32> for USizeVec2 {
2343
    #[inline]
2344
    fn shl_assign(&mut self, rhs: u32) {
3✔
2345
        *self = self.shl(rhs);
3✔
2346
    }
2347
}
2348

2349
impl ShlAssign<&u32> for USizeVec2 {
2350
    #[inline]
2351
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2352
        self.shl_assign(*rhs);
3✔
2353
    }
2354
}
2355

2356
impl Shr<u32> for USizeVec2 {
2357
    type Output = Self;
2358
    #[inline]
2359
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2360
        Self {
2361
            x: self.x.shr(rhs),
3✔
2362
            y: self.y.shr(rhs),
3✔
2363
        }
2364
    }
2365
}
2366

2367
impl Shr<&u32> for USizeVec2 {
2368
    type Output = Self;
2369
    #[inline]
2370
    fn shr(self, rhs: &u32) -> Self {
3✔
2371
        self.shr(*rhs)
3✔
2372
    }
2373
}
2374

2375
impl Shr<&u32> for &USizeVec2 {
2376
    type Output = USizeVec2;
2377
    #[inline]
2378
    fn shr(self, rhs: &u32) -> USizeVec2 {
3✔
2379
        (*self).shr(*rhs)
3✔
2380
    }
2381
}
2382

2383
impl Shr<u32> for &USizeVec2 {
2384
    type Output = USizeVec2;
2385
    #[inline]
2386
    fn shr(self, rhs: u32) -> USizeVec2 {
3✔
2387
        (*self).shr(rhs)
3✔
2388
    }
2389
}
2390

2391
impl ShrAssign<u32> for USizeVec2 {
2392
    #[inline]
2393
    fn shr_assign(&mut self, rhs: u32) {
3✔
2394
        *self = self.shr(rhs);
3✔
2395
    }
2396
}
2397

2398
impl ShrAssign<&u32> for USizeVec2 {
2399
    #[inline]
2400
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2401
        self.shr_assign(*rhs);
3✔
2402
    }
2403
}
2404

2405
impl Shl<u64> for USizeVec2 {
2406
    type Output = Self;
2407
    #[inline]
2408
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2409
        Self {
2410
            x: self.x.shl(rhs),
3✔
2411
            y: self.y.shl(rhs),
3✔
2412
        }
2413
    }
2414
}
2415

2416
impl Shl<&u64> for USizeVec2 {
2417
    type Output = Self;
2418
    #[inline]
2419
    fn shl(self, rhs: &u64) -> Self {
3✔
2420
        self.shl(*rhs)
3✔
2421
    }
2422
}
2423

2424
impl Shl<&u64> for &USizeVec2 {
2425
    type Output = USizeVec2;
2426
    #[inline]
2427
    fn shl(self, rhs: &u64) -> USizeVec2 {
3✔
2428
        (*self).shl(*rhs)
3✔
2429
    }
2430
}
2431

2432
impl Shl<u64> for &USizeVec2 {
2433
    type Output = USizeVec2;
2434
    #[inline]
2435
    fn shl(self, rhs: u64) -> USizeVec2 {
3✔
2436
        (*self).shl(rhs)
3✔
2437
    }
2438
}
2439

2440
impl ShlAssign<u64> for USizeVec2 {
2441
    #[inline]
2442
    fn shl_assign(&mut self, rhs: u64) {
3✔
2443
        *self = self.shl(rhs);
3✔
2444
    }
2445
}
2446

2447
impl ShlAssign<&u64> for USizeVec2 {
2448
    #[inline]
2449
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2450
        self.shl_assign(*rhs);
3✔
2451
    }
2452
}
2453

2454
impl Shr<u64> for USizeVec2 {
2455
    type Output = Self;
2456
    #[inline]
2457
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2458
        Self {
2459
            x: self.x.shr(rhs),
3✔
2460
            y: self.y.shr(rhs),
3✔
2461
        }
2462
    }
2463
}
2464

2465
impl Shr<&u64> for USizeVec2 {
2466
    type Output = Self;
2467
    #[inline]
2468
    fn shr(self, rhs: &u64) -> Self {
3✔
2469
        self.shr(*rhs)
3✔
2470
    }
2471
}
2472

2473
impl Shr<&u64> for &USizeVec2 {
2474
    type Output = USizeVec2;
2475
    #[inline]
2476
    fn shr(self, rhs: &u64) -> USizeVec2 {
3✔
2477
        (*self).shr(*rhs)
3✔
2478
    }
2479
}
2480

2481
impl Shr<u64> for &USizeVec2 {
2482
    type Output = USizeVec2;
2483
    #[inline]
2484
    fn shr(self, rhs: u64) -> USizeVec2 {
3✔
2485
        (*self).shr(rhs)
3✔
2486
    }
2487
}
2488

2489
impl ShrAssign<u64> for USizeVec2 {
2490
    #[inline]
2491
    fn shr_assign(&mut self, rhs: u64) {
3✔
2492
        *self = self.shr(rhs);
3✔
2493
    }
2494
}
2495

2496
impl ShrAssign<&u64> for USizeVec2 {
2497
    #[inline]
2498
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2499
        self.shr_assign(*rhs);
3✔
2500
    }
2501
}
2502

2503
impl Shl<IVec2> for USizeVec2 {
2504
    type Output = Self;
2505
    #[inline]
2506
    fn shl(self, rhs: IVec2) -> Self {
3✔
2507
        Self {
2508
            x: self.x.shl(rhs.x),
3✔
2509
            y: self.y.shl(rhs.y),
3✔
2510
        }
2511
    }
2512
}
2513

2514
impl Shl<&IVec2> for USizeVec2 {
2515
    type Output = Self;
2516
    #[inline]
2517
    fn shl(self, rhs: &IVec2) -> Self {
3✔
2518
        self.shl(*rhs)
3✔
2519
    }
2520
}
2521

2522
impl Shl<&IVec2> for &USizeVec2 {
2523
    type Output = USizeVec2;
2524
    #[inline]
2525
    fn shl(self, rhs: &IVec2) -> USizeVec2 {
3✔
2526
        (*self).shl(*rhs)
3✔
2527
    }
2528
}
2529

2530
impl Shl<IVec2> for &USizeVec2 {
2531
    type Output = USizeVec2;
2532
    #[inline]
2533
    fn shl(self, rhs: IVec2) -> USizeVec2 {
3✔
2534
        (*self).shl(rhs)
3✔
2535
    }
2536
}
2537

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

2549
impl Shr<&IVec2> for USizeVec2 {
2550
    type Output = Self;
2551
    #[inline]
2552
    fn shr(self, rhs: &IVec2) -> Self {
3✔
2553
        self.shr(*rhs)
3✔
2554
    }
2555
}
2556

2557
impl Shr<&IVec2> for &USizeVec2 {
2558
    type Output = USizeVec2;
2559
    #[inline]
2560
    fn shr(self, rhs: &IVec2) -> USizeVec2 {
3✔
2561
        (*self).shr(*rhs)
3✔
2562
    }
2563
}
2564

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

2573
impl Shl<UVec2> for USizeVec2 {
2574
    type Output = Self;
2575
    #[inline]
2576
    fn shl(self, rhs: UVec2) -> Self {
3✔
2577
        Self {
2578
            x: self.x.shl(rhs.x),
3✔
2579
            y: self.y.shl(rhs.y),
3✔
2580
        }
2581
    }
2582
}
2583

2584
impl Shl<&UVec2> for USizeVec2 {
2585
    type Output = Self;
2586
    #[inline]
2587
    fn shl(self, rhs: &UVec2) -> Self {
3✔
2588
        self.shl(*rhs)
3✔
2589
    }
2590
}
2591

2592
impl Shl<&UVec2> for &USizeVec2 {
2593
    type Output = USizeVec2;
2594
    #[inline]
2595
    fn shl(self, rhs: &UVec2) -> USizeVec2 {
3✔
2596
        (*self).shl(*rhs)
3✔
2597
    }
2598
}
2599

2600
impl Shl<UVec2> for &USizeVec2 {
2601
    type Output = USizeVec2;
2602
    #[inline]
2603
    fn shl(self, rhs: UVec2) -> USizeVec2 {
3✔
2604
        (*self).shl(rhs)
3✔
2605
    }
2606
}
2607

2608
impl Shr<UVec2> for USizeVec2 {
2609
    type Output = Self;
2610
    #[inline]
2611
    fn shr(self, rhs: UVec2) -> Self {
3✔
2612
        Self {
2613
            x: self.x.shr(rhs.x),
3✔
2614
            y: self.y.shr(rhs.y),
3✔
2615
        }
2616
    }
2617
}
2618

2619
impl Shr<&UVec2> for USizeVec2 {
2620
    type Output = Self;
2621
    #[inline]
2622
    fn shr(self, rhs: &UVec2) -> Self {
3✔
2623
        self.shr(*rhs)
3✔
2624
    }
2625
}
2626

2627
impl Shr<&UVec2> for &USizeVec2 {
2628
    type Output = USizeVec2;
2629
    #[inline]
2630
    fn shr(self, rhs: &UVec2) -> USizeVec2 {
3✔
2631
        (*self).shr(*rhs)
3✔
2632
    }
2633
}
2634

2635
impl Shr<UVec2> for &USizeVec2 {
2636
    type Output = USizeVec2;
2637
    #[inline]
2638
    fn shr(self, rhs: UVec2) -> USizeVec2 {
3✔
2639
        (*self).shr(rhs)
3✔
2640
    }
2641
}
2642

2643
impl Index<usize> for USizeVec2 {
2644
    type Output = usize;
2645
    #[inline]
2646
    fn index(&self, index: usize) -> &Self::Output {
3✔
2647
        match index {
6✔
2648
            0 => &self.x,
3✔
2649
            1 => &self.y,
3✔
2650
            _ => panic!("index out of bounds"),
×
2651
        }
2652
    }
2653
}
2654

2655
impl IndexMut<usize> for USizeVec2 {
2656
    #[inline]
2657
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2658
        match index {
6✔
2659
            0 => &mut self.x,
3✔
2660
            1 => &mut self.y,
3✔
2661
            _ => panic!("index out of bounds"),
×
2662
        }
2663
    }
2664
}
2665

2666
impl fmt::Display for USizeVec2 {
2667
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2668
        write!(f, "[{}, {}]", self.x, self.y)
3✔
2669
    }
2670
}
2671

2672
impl fmt::Debug for USizeVec2 {
2673
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2674
        fmt.debug_tuple(stringify!(USizeVec2))
3✔
2675
            .field(&self.x)
3✔
2676
            .field(&self.y)
3✔
2677
            .finish()
2678
    }
2679
}
2680

2681
impl From<[usize; 2]> for USizeVec2 {
2682
    #[inline]
2683
    fn from(a: [usize; 2]) -> Self {
×
2684
        Self::new(a[0], a[1])
3✔
2685
    }
2686
}
2687

2688
impl From<USizeVec2> for [usize; 2] {
2689
    #[inline]
2690
    fn from(v: USizeVec2) -> Self {
3✔
2691
        [v.x, v.y]
3✔
2692
    }
2693
}
2694

2695
impl From<(usize, usize)> for USizeVec2 {
2696
    #[inline]
2697
    fn from(t: (usize, usize)) -> Self {
3✔
2698
        Self::new(t.0, t.1)
×
2699
    }
2700
}
2701

2702
impl From<USizeVec2> for (usize, usize) {
2703
    #[inline]
2704
    fn from(v: USizeVec2) -> Self {
3✔
2705
        (v.x, v.y)
×
2706
    }
2707
}
2708

2709
impl From<U8Vec2> for USizeVec2 {
2710
    #[inline]
2711
    fn from(v: U8Vec2) -> Self {
3✔
2712
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2713
    }
2714
}
2715

2716
impl From<U16Vec2> for USizeVec2 {
2717
    #[inline]
2718
    fn from(v: U16Vec2) -> Self {
3✔
2719
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2720
    }
2721
}
2722

2723
impl TryFrom<I8Vec2> for USizeVec2 {
2724
    type Error = core::num::TryFromIntError;
2725

2726
    #[inline]
2727
    fn try_from(v: I8Vec2) -> Result<Self, Self::Error> {
3✔
2728
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2729
    }
2730
}
2731

2732
impl TryFrom<I16Vec2> for USizeVec2 {
2733
    type Error = core::num::TryFromIntError;
2734

2735
    #[inline]
2736
    fn try_from(v: I16Vec2) -> Result<Self, Self::Error> {
3✔
2737
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2738
    }
2739
}
2740

2741
impl TryFrom<IVec2> for USizeVec2 {
2742
    type Error = core::num::TryFromIntError;
2743

2744
    #[inline]
2745
    fn try_from(v: IVec2) -> Result<Self, Self::Error> {
3✔
2746
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2747
    }
2748
}
2749

2750
impl TryFrom<I64Vec2> for USizeVec2 {
2751
    type Error = core::num::TryFromIntError;
2752

2753
    #[inline]
2754
    fn try_from(v: I64Vec2) -> Result<Self, Self::Error> {
3✔
2755
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2756
    }
2757
}
2758

2759
impl TryFrom<UVec2> for USizeVec2 {
2760
    type Error = core::num::TryFromIntError;
2761

2762
    #[inline]
2763
    fn try_from(v: UVec2) -> Result<Self, Self::Error> {
3✔
2764
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2765
    }
2766
}
2767

2768
impl TryFrom<U64Vec2> for USizeVec2 {
2769
    type Error = core::num::TryFromIntError;
2770

2771
    #[inline]
2772
    fn try_from(v: U64Vec2) -> Result<Self, Self::Error> {
3✔
2773
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2774
    }
2775
}
2776

2777
impl TryFrom<ISizeVec2> for USizeVec2 {
2778
    type Error = core::num::TryFromIntError;
2779

2780
    #[inline]
2781
    fn try_from(v: ISizeVec2) -> Result<Self, Self::Error> {
3✔
2782
        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
3✔
2783
    }
2784
}
2785

2786
impl From<BVec2> for USizeVec2 {
2787
    #[inline]
2788
    fn from(v: BVec2) -> Self {
3✔
2789
        Self::new(usize::from(v.x), usize::from(v.y))
3✔
2790
    }
2791
}
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