Skip to content

Commit

Permalink
lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
zorancv committed Nov 29, 2023
1 parent a3a8405 commit fc4af81
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 133 deletions.
2 changes: 1 addition & 1 deletion graph/src/data/store/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl IdList {
}
}

pub fn index(&self, index: usize) -> IdRef<'_> {
pub fn index<'b>(&'b self, index: usize) -> IdRef<'b> {
match self {
IdList::String(ids) => IdRef::String(&ids[index]),
IdList::Bytes(ids) => IdRef::Bytes(ids[index].as_slice()),
Expand Down
10 changes: 5 additions & 5 deletions store/postgres/src/block_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ impl<'a> BlockRangeColumn<'a> {
/// whether the brin index should be used. If `true`, the brin index is not used.
pub fn contains<'b>(
&'b self,
mut out: AstPass<'b, 'b, Pg>,
out: &mut AstPass<'_, 'b, Pg>,
filters_by_id: bool,
) -> QueryResult<()> {
out.unsafe_to_cache_prepared();

match self {
BlockRangeColumn::Mutable { table, block, .. } => {
self.name(&mut out);
self.name(out);
out.push_sql(" @> ");
out.push_bind_param::<Integer, _>(block)?;

Expand Down Expand Up @@ -211,7 +211,7 @@ impl<'a> BlockRangeColumn<'a> {
out.push_sql("true");
Ok(())
} else {
self.name(&mut out);
self.name(out);
out.push_sql(" <= ");
out.push_bind_param::<Integer, _>(block)
}
Expand Down Expand Up @@ -255,7 +255,7 @@ impl<'a> BlockRangeColumn<'a> {
/// # Panics
///
/// If the underlying table is immutable, this method will panic
pub fn clamp<'b>(&'b self, out: &mut AstPass<'b, 'b, Pg>) -> QueryResult<()> {
pub fn clamp<'b>(&'b self, out: &mut AstPass<'_, 'b, Pg>) -> QueryResult<()> {
match self {
BlockRangeColumn::Mutable { block, .. } => {
self.name(out);
Expand All @@ -282,7 +282,7 @@ impl<'a> BlockRangeColumn<'a> {

/// Output an expression that matches all rows that have been changed
/// after `block` (inclusive)
pub(crate) fn changed_since<'b>(&'b self, out: &mut AstPass<'b, 'b, Pg>) -> QueryResult<()> {
pub(crate) fn changed_since<'b>(&'b self, out: &mut AstPass<'_, 'b, Pg>) -> QueryResult<()> {
match self {
BlockRangeColumn::Mutable { block, .. } => {
out.push_sql("lower(");
Expand Down
Loading

0 comments on commit fc4af81

Please sign in to comment.