Skip to content

Commit b65128a

Browse files
committed
Clarify docs in session accessors
Signed-off-by: Nicholas Gates <[email protected]>
1 parent add61b0 commit b65128a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vortex-session/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
pub mod registry;
55

6-
use std::any::type_name;
76
use std::any::Any;
87
use std::any::TypeId;
8+
use std::any::type_name;
99
use std::fmt::Debug;
1010
use std::hash::BuildHasherDefault;
1111
use std::hash::Hasher;
@@ -15,8 +15,8 @@ use std::sync::Arc;
1515

1616
use dashmap::DashMap;
1717
use dashmap::Entry;
18-
use vortex_error::vortex_panic;
1918
use vortex_error::VortexExpect;
19+
use vortex_error::vortex_panic;
2020

2121
/// A Vortex session encapsulates the set of extensible arrays, layouts, compute functions, dtypes,
2222
/// etc. that are available for use in a given context.
@@ -68,7 +68,7 @@ pub trait SessionExt: Sized + private::Sealed {
6868
/// Returns the scope variable of type `V`, or inserts a default one if it does not exist.
6969
///
7070
/// Note that the returned value internally holds a lock on the variable.
71-
fn get_mut<V: SessionVar>(&self) -> RefMut<'_, V>;
71+
fn get_mut<V: SessionVar + Default>(&self) -> RefMut<'_, V>;
7272

7373
/// Returns the scope variable of type `V`, if it exists.
7474
///
@@ -133,8 +133,8 @@ impl SessionExt for VortexSession {
133133
self.0.get_mut(&TypeId::of::<V>()).map(|v| {
134134
RefMut(v.map(|v| {
135135
(**v)
136-
.as_any()
137-
.downcast_ref::<V>()
136+
.as_any_mut()
137+
.downcast_mut::<V>()
138138
.vortex_expect("Type mismatch - this is a bug")
139139
}))
140140
})

0 commit comments

Comments
 (0)