Merge pull request #60 from miguelraz/as-slice-prettify

AsRef -> as_slice cleanup
This commit is contained in:
Jubilee 2021-02-04 16:48:22 -08:00 committed by GitHub
commit acbde0353c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
{
@ -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)