Skip to content

Commit 2ccf515

Browse files
committed
chore: constrain the lifetime of SessionExt::get
Seems pretty reasonable that it should live at least as long as the Session itself, right? Signed-off-by: Daniel King <[email protected]>
1 parent 243deeb commit 2ccf515

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

vortex-array/src/expr/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Default for ExprSession {
7474
/// Extension trait for accessing expression session data.
7575
pub trait ExprSessionExt: SessionExt {
7676
/// Returns the expression vtable registry.
77-
fn expressions(&self) -> Ref<'_, ExprSession> {
77+
fn expressions<'a>(&'a self) -> Ref<'a, ExprSession> {
7878
self.get::<ExprSession>()
7979
}
8080
}

vortex-array/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl Default for ArraySession {
124124
/// Session data for Vortex arrays.
125125
pub trait ArraySessionExt: SessionExt {
126126
/// Returns the array encoding registry.
127-
fn arrays(&self) -> Ref<'_, ArraySession> {
127+
fn arrays<'a>(&'a self) -> Ref<'a, ArraySession> {
128128
self.get::<ArraySession>()
129129
}
130130
}

vortex-layout/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Default for LayoutSession {
5656
/// Extension trait for accessing layout session data.
5757
pub trait LayoutSessionExt: SessionExt {
5858
/// Returns the layout encoding registry.
59-
fn layouts(&self) -> Ref<'_, LayoutSession> {
59+
fn layouts<'a>(&'a self) -> Ref<'a, LayoutSession> {
6060
self.get::<LayoutSession>()
6161
}
6262
}

vortex-session/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ pub trait SessionExt: Sized + private::Sealed {
5454
fn session(&self) -> VortexSession;
5555

5656
/// Returns the scope variable of type `V`, or inserts a default one if it does not exist.
57-
fn get<V: SessionVar>(&self) -> Ref<'_, V>;
57+
fn get<'a, V: SessionVar>(&'a self) -> Ref<'a, V>;
5858

5959
/// Returns the scope variable of type `V`, or inserts a default one if it does not exist.
6060
///
6161
/// Note that the returned value internally holds a lock on the variable.
62-
fn get_mut<V: SessionVar>(&self) -> RefMut<'_, V>;
62+
fn get_mut<'a, V: SessionVar>(&'a self) -> RefMut<'a, V>;
6363
}
6464

6565
mod private {
@@ -73,7 +73,7 @@ impl SessionExt for VortexSession {
7373
}
7474

7575
/// Returns the scope variable of type `V`, or inserts a default one if it does not exist.
76-
fn get<V: SessionVar>(&self) -> Ref<'_, V> {
76+
fn get<'a, V: SessionVar>(&'a self) -> Ref<'a, V> {
7777
Ref(self
7878
.0
7979
.get(&TypeId::of::<V>())
@@ -91,7 +91,7 @@ impl SessionExt for VortexSession {
9191
/// Returns the scope variable of type `V`, or inserts a default one if it does not exist.
9292
///
9393
/// Note that the returned value internally holds a lock on the variable.
94-
fn get_mut<V: SessionVar>(&self) -> RefMut<'_, V> {
94+
fn get_mut<'a, V: SessionVar>(&'a self) -> RefMut<'a, V> {
9595
RefMut(
9696
self.0
9797
.get_mut(&TypeId::of::<V>())

0 commit comments

Comments
 (0)