Skip to content

Commit 29664d0

Browse files
authored
cmov: consolidate allow(clippy::cast_possible_truncation) attrs (#1413)
1 parent 61808d5 commit 29664d0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

cmov/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ macro_rules! impl_cmov_traits_for_size_int {
220220
target_pointer_width = "64"
221221
))]
222222
#[cfg_attr(docsrs, doc(cfg(true)))]
223+
#[allow(clippy::cast_possible_truncation)]
223224
impl Cmov for $size {
224225
#[cfg(target_pointer_width = "16")]
225-
#[allow(clippy::cast_possible_truncation)]
226226
#[inline]
227227
fn cmovnz(&mut self, other: &Self, condition: Condition) {
228228
let mut tmp = *self as $int16;
@@ -231,7 +231,6 @@ macro_rules! impl_cmov_traits_for_size_int {
231231
}
232232

233233
#[cfg(target_pointer_width = "32")]
234-
#[allow(clippy::cast_possible_truncation)]
235234
#[inline]
236235
fn cmovnz(&mut self, other: &Self, condition: Condition) {
237236
let mut tmp = *self as $int32;
@@ -240,7 +239,6 @@ macro_rules! impl_cmov_traits_for_size_int {
240239
}
241240

242241
#[cfg(target_pointer_width = "64")]
243-
#[allow(clippy::cast_possible_truncation)]
244242
#[inline]
245243
fn cmovnz(&mut self, other: &Self, condition: Condition) {
246244
let mut tmp = *self as $int64;
@@ -255,23 +253,21 @@ macro_rules! impl_cmov_traits_for_size_int {
255253
target_pointer_width = "64"
256254
))]
257255
#[cfg_attr(docsrs, doc(cfg(true)))]
256+
#[allow(clippy::cast_possible_truncation)]
258257
impl CmovEq for $size {
259258
#[cfg(target_pointer_width = "16")]
260-
#[allow(clippy::cast_possible_truncation)]
261259
#[inline]
262260
fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) {
263261
(*self as $int16).cmovne(&(*rhs as $int16), input, output);
264262
}
265263

266264
#[cfg(target_pointer_width = "32")]
267-
#[allow(clippy::cast_possible_truncation)]
268265
#[inline]
269266
fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) {
270267
(*self as $int32).cmovne(&(*rhs as $int32), input, output);
271268
}
272269

273270
#[cfg(target_pointer_width = "64")]
274-
#[allow(clippy::cast_possible_truncation)]
275271
#[inline]
276272
fn cmovne(&self, rhs: &Self, input: Condition, output: &mut Condition) {
277273
(*self as $int64).cmovne(&(*rhs as $int64), input, output);

0 commit comments

Comments
 (0)