Skip to content

Commit 8da3546

Browse files
committed
allow inlining Step methods
1 parent b62d1d9 commit 8da3546

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/addr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ impl VirtAddr {
236236
}
237237

238238
// FIXME: Move this into the `Step` impl, once `Step` is stabilized.
239+
#[inline]
239240
pub(crate) fn forward_checked_impl(start: Self, count: usize) -> Option<Self> {
240241
let offset = u64::try_from(count).ok()?;
241242
if offset > ADDRESS_SPACE_SIZE {
@@ -343,14 +344,17 @@ impl Sub<VirtAddr> for VirtAddr {
343344

344345
#[cfg(feature = "step_trait")]
345346
impl Step for VirtAddr {
347+
#[inline]
346348
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
347349
Self::steps_between_impl(start, end)
348350
}
349351

352+
#[inline]
350353
fn forward_checked(start: Self, count: usize) -> Option<Self> {
351354
Self::forward_checked_impl(start, count)
352355
}
353356

357+
#[inline]
354358
fn backward_checked(start: Self, count: usize) -> Option<Self> {
355359
let offset = u64::try_from(count).ok()?;
356360
if offset > ADDRESS_SPACE_SIZE {

0 commit comments

Comments
 (0)