From e5124e13a79de218b6c2320d935da135f09da3ed Mon Sep 17 00:00:00 2001 From: Elliott Linder Date: Mon, 10 Jun 2019 12:26:26 +0200 Subject: [PATCH] refactor: prevent 'FreeRegionIter' from being exposed --- src/alloc/search.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/alloc/search.rs b/src/alloc/search.rs index 1af41bec..fa04688c 100644 --- a/src/alloc/search.rs +++ b/src/alloc/search.rs @@ -2,12 +2,12 @@ use crate::error::{Error, Result}; use std::ops::Range; /// Returns an iterator for free after the specified address. -pub fn after(origin: *const (), range: Option>) -> FreeRegionIter { +pub fn after(origin: *const (), range: Option>) -> impl Iterator> { FreeRegionIter::new(origin, range, SearchDirection::After) } /// Returns an iterator for free before the specified address. -pub fn before(origin: *const (), range: Option>) -> FreeRegionIter { +pub fn before(origin: *const (), range: Option>) -> impl Iterator> { FreeRegionIter::new(origin, range, SearchDirection::Before) } @@ -18,7 +18,7 @@ enum SearchDirection { } /// An iterator searching for free regions. -pub struct FreeRegionIter { +struct FreeRegionIter { range: Range, search: SearchDirection, current: usize,