Skip to content

Commit

Permalink
Merge pull request #16 from vetio/check_range-rename
Browse files Browse the repository at this point in the history
Change `slice::check_range` to `RangeBounds::assert_len`
  • Loading branch information
phil-opp committed Oct 31, 2020
2 parents 0a709e1 + df5562f commit 1e20835
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#![no_std]
#![cfg_attr(feature = "unstable", feature(core_intrinsics))]
#![cfg_attr(feature = "unstable", feature(const_generics))]
#![cfg_attr(feature = "unstable", feature(slice_check_range))]
#![cfg_attr(feature = "unstable", feature(range_bounds_assert_len))]
#![cfg_attr(feature = "unstable", allow(incomplete_features))]
#![warn(missing_docs)]

Expand All @@ -25,7 +25,6 @@ use core::{
use core::{
intrinsics,
ops::{Range, RangeBounds},
slice,
};

/// Allows creating read-only and write-only `Volatile` values.
Expand Down Expand Up @@ -625,7 +624,7 @@ where
let Range {
start: src_start,
end: src_end,
} = slice::check_range(self.reference.len(), src);
} = src.assert_len(self.reference.len());
let count = src_end - src_start;
assert!(
dest <= self.reference.len() - count,
Expand Down

0 comments on commit 1e20835

Please sign in to comment.