Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/heads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl AuthorHeads {
}

/// Create an iterator over the entries in this state.
pub fn iter(&self) -> std::collections::btree_map::Iter<AuthorId, Timestamp> {
pub fn iter(&self) -> std::collections::btree_map::Iter<'_, AuthorId, Timestamp> {
self.heads.iter()
}

Expand Down
2 changes: 2 additions & 0 deletions src/ranger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ impl<E: RangeEntry> Message<E> {
}
}

#[allow(dead_code)]
pub trait Store<E: RangeEntry>: Sized {
type Error: Debug + Send + Sync + Into<anyhow::Error> + 'static;

Expand Down Expand Up @@ -874,6 +875,7 @@ mod tests {
enum SimpleFilter<K> {
None,
Range(Range<K>),
#[allow(dead_code)]
Prefix(K),
}

Expand Down
11 changes: 7 additions & 4 deletions src/store/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl Store {
///
/// As such, there is also no guarantee that the data you see is
/// already persisted.
fn tables(&mut self) -> Result<&Tables> {
fn tables(&mut self) -> Result<&Tables<'_>> {
let guard = &mut self.transaction;
let tables = match std::mem::take(guard) {
CurrentTransaction::None => {
Expand Down Expand Up @@ -258,7 +258,7 @@ type PeersIter = std::vec::IntoIter<PeerIdBytes>;

impl Store {
/// Create a new replica for `namespace` and persist in this store.
pub fn new_replica(&mut self, namespace: NamespaceSecret) -> Result<Replica> {
pub fn new_replica(&mut self, namespace: NamespaceSecret) -> Result<Replica<'_>> {
let id = namespace.id();
self.import_namespace(namespace.into())?;
self.open_replica(&id).map_err(Into::into)
Expand Down Expand Up @@ -295,7 +295,7 @@ impl Store {
/// Open a replica from this store.
///
/// This just calls load_replica_info and then creates a new replica with the info.
pub fn open_replica(&mut self, namespace_id: &NamespaceId) -> Result<Replica, OpenError> {
pub fn open_replica(&mut self, namespace_id: &NamespaceId) -> Result<Replica<'_>, OpenError> {
let info = self.load_replica_info(namespace_id)?;
let instance = StoreInstance::new(*namespace_id, self);
Ok(Replica::new(instance, Box::new(info)))
Expand Down Expand Up @@ -465,7 +465,10 @@ impl Store {
}

/// Get the latest entry for each author in a namespace.
pub fn get_latest_for_each_author(&mut self, namespace: NamespaceId) -> Result<LatestIterator> {
pub fn get_latest_for_each_author(
&mut self,
namespace: NamespaceId,
) -> Result<LatestIterator<'_>> {
LatestIterator::new(&self.tables()?.latest_per_author, namespace)
}

Expand Down
8 changes: 4 additions & 4 deletions src/store/fs/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ impl RecordsBounds {
Self::new(start, Self::namespace_end(ns))
}

pub fn as_ref(&self) -> (Bound<RecordsId>, Bound<RecordsId>) {
fn map(id: &RecordsIdOwned) -> RecordsId {
pub fn as_ref(&self) -> (Bound<RecordsId<'_>>, Bound<RecordsId<'_>>) {
fn map(id: &RecordsIdOwned) -> RecordsId<'_> {
(&id.0, &id.1, &id.2[..])
}
(map_bound(&self.0, map), map_bound(&self.1, map))
Expand Down Expand Up @@ -139,8 +139,8 @@ impl ByKeyBounds {
Self(start, end)
}

pub fn as_ref(&self) -> (Bound<RecordsByKeyId>, Bound<RecordsByKeyId>) {
fn map(id: &RecordsByKeyIdOwned) -> RecordsByKeyId {
pub fn as_ref(&self) -> (Bound<RecordsByKeyId<'_>>, Bound<RecordsByKeyId<'_>>) {
fn map(id: &RecordsByKeyIdOwned) -> RecordsByKeyId<'_> {
(&id.0, &id.1[..], &id.2)
}
(map_bound(&self.0, map), map_bound(&self.1, map))
Expand Down
2 changes: 1 addition & 1 deletion src/store/fs/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl TransactionAndTables {
})
}

pub fn tables(&self) -> &Tables {
pub fn tables(&self) -> &Tables<'_> {
self.inner.borrow_dependent()
}

Expand Down
Loading