Skip to content

Commit

Permalink
[ci] Fix rust 1.83 warnings #1365 (#1366)
Browse files Browse the repository at this point in the history
update lifetime annotations
  • Loading branch information
michaelvlach authored Nov 30, 2024
1 parent df8b7e6 commit af5a10d
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion agdb/src/collections/indexed_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ where
Ok(())
}

pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<K, T, D, DataKT> {
pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<'a, K, T, D, DataKT> {
self.keys_to_values.iter(storage)
}

Expand Down
4 changes: 2 additions & 2 deletions agdb/src/collections/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ where
pub phantom_data: PhantomData<(K, T, D)>,
}

impl<'a, K, T, D, Data> Iterator for MapIterator<'a, K, T, D, Data>
impl<K, T, D, Data> Iterator for MapIterator<'_, K, T, D, Data>
where
K: Default,
T: Default,
Expand Down Expand Up @@ -393,7 +393,7 @@ where
self.multi_map.is_empty()
}

pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<K, T, D, Data> {
pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<'a, K, T, D, Data> {
self.multi_map.iter(storage)
}

Expand Down
6 changes: 3 additions & 3 deletions agdb/src/collections/multi_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ where
pub phantom_data: PhantomData<(T, D)>,
}

impl<'a, K, T, D, Data> Iterator for MultiMapIterator<'a, K, T, D, Data>
impl<K, T, D, Data> Iterator for MultiMapIterator<'_, K, T, D, Data>
where
K: Default + PartialEq,
T: Default,
Expand Down Expand Up @@ -193,7 +193,7 @@ where
self.len() == 0
}

pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<K, T, D, Data> {
pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> MapIterator<'a, K, T, D, Data> {
MapIterator {
pos: 0,
data: &self.data,
Expand All @@ -206,7 +206,7 @@ where
&'a self,
storage: &'a Storage<D>,
key: &'a K,
) -> MultiMapIterator<K, T, D, Data> {
) -> MultiMapIterator<'a, K, T, D, Data> {
let pos = if self.capacity() == 0 {
0
} else {
Expand Down
4 changes: 2 additions & 2 deletions agdb/src/collections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ where

pub type DbVec<T, D> = VecImpl<T, D, DbVecData<T, D, DbError>, DbError>;

impl<'a, T, D, Data, E> Iterator for VecIterator<'a, T, D, Data, E>
impl<T, D, Data, E> Iterator for VecIterator<'_, T, D, Data, E>
where
T: VecValue,
D: StorageData,
Expand Down Expand Up @@ -295,7 +295,7 @@ where
self.len() == 0
}

pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> VecIterator<T, D, Data, E> {
pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> VecIterator<'a, T, D, Data, E> {
VecIterator {
index: 0,
vec: self,
Expand Down
2 changes: 1 addition & 1 deletion agdb/src/db/db_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
let index = DbIndex::new(key, storage)?;
self.storage_indexes.push(storage, &index.storage_index())?;
self.indexes.push(index);
return Ok(self.indexes.last_mut().unwrap());
Ok(self.indexes.last_mut().unwrap())
}

pub fn new(storage: &mut Storage<D>) -> Result<Self, DbError> {
Expand Down
10 changes: 5 additions & 5 deletions agdb/src/db/db_search_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ impl<'a, Store: StorageData> PathHandler<'a, Store> {
}
}

impl<'a, Store: StorageData> SearchHandler for DefaultHandler<'a, Store> {
impl<Store: StorageData> SearchHandler for DefaultHandler<'_, Store> {
fn process(&mut self, index: GraphIndex, distance: u64) -> Result<SearchControl, DbError> {
self.db
.evaluate_conditions(index, distance, self.conditions)
}
}

impl<'a, Store: StorageData> SearchHandler for LimitHandler<'a, Store> {
impl<Store: StorageData> SearchHandler for LimitHandler<'_, Store> {
fn process(&mut self, index: GraphIndex, distance: u64) -> Result<SearchControl, DbError> {
let control = self
.db
Expand All @@ -116,7 +116,7 @@ impl<'a, Store: StorageData> SearchHandler for LimitHandler<'a, Store> {
}
}

impl<'a, Store: StorageData> SearchHandler for OffsetHandler<'a, Store> {
impl<Store: StorageData> SearchHandler for OffsetHandler<'_, Store> {
fn process(&mut self, index: GraphIndex, distance: u64) -> Result<SearchControl, DbError> {
let mut control = self
.db
Expand All @@ -131,7 +131,7 @@ impl<'a, Store: StorageData> SearchHandler for OffsetHandler<'a, Store> {
}
}

impl<'a, Store: StorageData> SearchHandler for LimitOffsetHandler<'a, Store> {
impl<Store: StorageData> SearchHandler for LimitOffsetHandler<'_, Store> {
fn process(&mut self, index: GraphIndex, distance: u64) -> Result<SearchControl, DbError> {
let mut control = self
.db
Expand All @@ -150,7 +150,7 @@ impl<'a, Store: StorageData> SearchHandler for LimitOffsetHandler<'a, Store> {
}
}

impl<'a, Store: StorageData> PathSearchHandler for PathHandler<'a, Store> {
impl<Store: StorageData> PathSearchHandler for PathHandler<'_, Store> {
fn process(&self, index: GraphIndex, distance: u64) -> Result<(u64, bool), DbError> {
match self
.db
Expand Down
14 changes: 7 additions & 7 deletions agdb/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ where
self.index
}

pub fn edge_iter_from(&'a self) -> GraphEdgeIterator<D, Data> {
pub fn edge_iter_from(&'a self) -> GraphEdgeIterator<'a, D, Data> {
GraphEdgeIterator {
graph: self.graph,
index: self
Expand Down Expand Up @@ -357,7 +357,7 @@ where
storage: &'a Storage<D>,
}

impl<'a, D, Data> Iterator for GraphIterator<'a, D, Data>
impl<D, Data> Iterator for GraphIterator<'_, D, Data>
where
Data: GraphData<D>,
D: StorageData,
Expand Down Expand Up @@ -418,7 +418,7 @@ where
storage: &'a Storage<D>,
}

impl<'a, D, Data> GraphEdge<'a, D, Data>
impl<D, Data> GraphEdge<'_, D, Data>
where
Data: GraphData<D>,
D: StorageData,
Expand Down Expand Up @@ -528,7 +528,7 @@ where
&'a self,
storage: &'a Storage<D>,
index: GraphIndex,
) -> Option<GraphEdge<D, Data>> {
) -> Option<GraphEdge<'a, D, Data>> {
if self.validate_edge(storage, index).is_err() {
return None;
}
Expand Down Expand Up @@ -572,7 +572,7 @@ where
Ok(index)
}

pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> GraphIterator<D, Data> {
pub fn iter<'a>(&'a self, storage: &'a Storage<D>) -> GraphIterator<'a, D, Data> {
GraphIterator {
graph: self,
index: Some(GraphIndex::default()),
Expand All @@ -584,7 +584,7 @@ where
&'a self,
storage: &'a Storage<D>,
index: GraphIndex,
) -> Option<GraphNode<D, Data>> {
) -> Option<GraphNode<'a, D, Data>> {
if self.validate_node(storage, index).is_err() {
return None;
}
Expand All @@ -597,7 +597,7 @@ where
}

#[allow(dead_code)]
pub fn node_iter<'a>(&'a self, storage: &'a Storage<D>) -> GraphNodeIterator<D, Data> {
pub fn node_iter<'a>(&'a self, storage: &'a Storage<D>) -> GraphNodeIterator<'a, D, Data> {
GraphNodeIterator {
graph: self,
index: GraphIndex::default(),
Expand Down

0 comments on commit af5a10d

Please sign in to comment.