Skip to content

Commit

Permalink
Merge pull request rust-lang#60 from miguelraz/as-slice-prettify
Browse files Browse the repository at this point in the history
AsRef -> as_slice cleanup
  • Loading branch information
workingjubilee authored Feb 5, 2021
2 parents 9b6b5d7 + 8bea634 commit acbde03
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/core_simd/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ macro_rules! impl_unsigned_int_ops {

#[inline]
fn rem(self, rhs: Self) -> Self::Output {
// TODO there is probably a better way of doing this
if AsRef::<[$scalar]>::as_ref(&rhs)
if rhs.as_slice()
.iter()
.any(|x| *x == 0)
{
Expand Down Expand Up @@ -435,7 +434,7 @@ macro_rules! impl_unsigned_int_ops {
#[inline]
fn shl(self, rhs: Self) -> Self::Output {
// TODO there is probably a better way of doing this
if AsRef::<[$scalar]>::as_ref(&rhs)
if rhs.as_slice()
.iter()
.copied()
.any(invalid_shift_rhs)
Expand Down

0 comments on commit acbde03

Please sign in to comment.