Rename peek_next_free_id to peek_free_id (that it's the next is obvious) (#2243)
This commit is contained in:
parent
e317ad045e
commit
b97a9a1398
@ -149,8 +149,8 @@ where
|
|||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
#[inline]
|
#[inline]
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
self.inner.peek_next_free_id()
|
self.inner.peek_free_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -266,7 +266,7 @@ where
|
|||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
pub fn peek_next_free_id(&self) -> CorpusId {
|
pub fn peek_free_id(&self) -> CorpusId {
|
||||||
CorpusId::from(self.progressive_idx)
|
CorpusId::from(self.progressive_idx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,8 +438,8 @@ where
|
|||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
#[inline]
|
#[inline]
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
self.storage.peek_next_free_id()
|
self.storage.peek_free_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -151,8 +151,8 @@ where
|
|||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
#[inline]
|
#[inline]
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
self.inner.peek_next_free_id()
|
self.inner.peek_free_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -132,7 +132,7 @@ pub trait Corpus: UsesInput + Serialize + for<'de> Deserialize<'de> {
|
|||||||
fn next(&self, id: CorpusId) -> Option<CorpusId>;
|
fn next(&self, id: CorpusId) -> Option<CorpusId>;
|
||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
fn peek_next_free_id(&self) -> CorpusId;
|
fn peek_free_id(&self) -> CorpusId;
|
||||||
|
|
||||||
/// Get the prev corpus id
|
/// Get the prev corpus id
|
||||||
fn prev(&self, id: CorpusId) -> Option<CorpusId>;
|
fn prev(&self, id: CorpusId) -> Option<CorpusId>;
|
||||||
|
@ -89,7 +89,7 @@ where
|
|||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
#[inline]
|
#[inline]
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
CorpusId::from(0_usize)
|
CorpusId::from(0_usize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,8 +108,8 @@ where
|
|||||||
|
|
||||||
/// Peek the next free corpus id
|
/// Peek the next free corpus id
|
||||||
#[inline]
|
#[inline]
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
self.inner.peek_next_free_id()
|
self.inner.peek_free_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes an entry from the corpus, returning it if it was present.
|
/// Removes an entry from the corpus, returning it if it was present.
|
||||||
|
@ -203,8 +203,8 @@ where
|
|||||||
fn next(&self, id: CorpusId) -> Option<CorpusId> {
|
fn next(&self, id: CorpusId) -> Option<CorpusId> {
|
||||||
self.mapping.enabled.next(id)
|
self.mapping.enabled.next(id)
|
||||||
}
|
}
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
self.mapping.peek_next_free_id()
|
self.mapping.peek_free_id()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn prev(&self, id: CorpusId) -> Option<CorpusId> {
|
fn prev(&self, id: CorpusId) -> Option<CorpusId> {
|
||||||
@ -359,7 +359,7 @@ where
|
|||||||
maybe_last.ok_or_else(|| Error::illegal_argument("Can only get the last corpus ID."))
|
maybe_last.ok_or_else(|| Error::illegal_argument("Can only get the last corpus ID."))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn peek_next_free_id(&self) -> CorpusId {
|
fn peek_free_id(&self) -> CorpusId {
|
||||||
CorpusId::from(self.count)
|
CorpusId::from(self.count)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user