Skip to content

Commit 0cf218d

Browse files
GabrielMajerignzlbg
authored andcommitted
Fix Clippy lints
1 parent 7a7188c commit 0cf218d

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

examples/aobench/src/random.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub mod scalar {
2525
| ((x & 0xff00_u32) << 8)
2626
| ((x & 0x00ff_0000_u32) >> 8)
2727
| (x & 0xff00_0000_u32) >> 24;
28-
RngT(z0, z1, z2, z3)
28+
Self(z0, z1, z2, z3)
2929
}
3030

3131
pub fn gen_u32(&mut self) -> u32 {
@@ -88,7 +88,7 @@ pub mod vector {
8888
| ((x & u32xN::splat(0xff00)) << 8)
8989
| ((x & u32xN::splat(0x00ff_0000)) >> 8)
9090
| (x & u32xN::splat(0xff00_0000)) >> 24;
91-
RngT(z0, z1, z2, z3)
91+
Self(z0, z1, z2, z3)
9292
}
9393

9494
#[inline(always)]

examples/spectral_norm/src/scalar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ struct f64x2(f64, f64);
1010
impl Add for f64x2 {
1111
type Output = Self;
1212
fn add(self, rhs: Self) -> Self {
13-
f64x2(self.0 + rhs.0, self.1 + rhs.1)
13+
Self(self.0 + rhs.0, self.1 + rhs.1)
1414
}
1515
}
1616
impl Div for f64x2 {
1717
type Output = Self;
1818
fn div(self, rhs: Self) -> Self {
19-
f64x2(self.0 / rhs.0, self.1 / rhs.1)
19+
Self(self.0 / rhs.0, self.1 / rhs.1)
2020
}
2121
}
2222

examples/triangle_xform/src/scalar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Triangle {
3333
xformed[k] = [x, y, z];
3434
}
3535

36-
Triangle(xformed)
36+
Self(xformed)
3737
}
3838
}
3939

src/api/cast.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
//! Implementation of `FromCast` and `IntoCast`.
2-
#![cfg_attr(feature = "cargo-clippy", allow(clippy::stutter))]
2+
#![cfg_attr(
3+
feature = "cargo-clippy",
4+
allow(
5+
clippy::module_name_repetitions,
6+
clippy::stutter
7+
)
8+
)]
39

410
/// Numeric cast from `T` to `Self`.
511
///

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@
222222
clippy::cast_possible_truncation,
223223
clippy::cast_lossless,
224224
clippy::cast_possible_wrap,
225-
clippy::cast_precision_loss
225+
clippy::cast_precision_loss,
226+
// This lint is currently broken for generic code
227+
// See https://github.com/rust-lang/rust-clippy/issues/3410
228+
clippy::use_self
226229
)
227230
)]
228231
#![cfg_attr(

0 commit comments

Comments
 (0)