Rename peek_next_free_id to peek_free_id (that it's the next is obvious) (#2243)

This commit is contained in:
Dominik Maier 2024-05-23 15:44:32 +02:00 committed by GitHub
parent e317ad045e
commit b97a9a1398
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 14 additions and 14 deletions

View File

@ -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]

View File

@ -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]

View File

@ -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]

View File

@ -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>;

View File

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

View File

@ -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.

View File

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