File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 66use std:: path:: Path ;
77
88use vortex:: array:: arrays:: StructArray ;
9- use vortex:: array:: builders:: { ArrayBuilder , DecimalBuilder , VarBinViewBuilder } ;
9+ use vortex:: array:: builders:: ArrayBuilder ;
10+ use vortex:: array:: builders:: DecimalBuilder ;
11+ use vortex:: array:: builders:: VarBinViewBuilder ;
1012use vortex:: array:: validity:: Validity ;
11- use vortex:: dtype:: { DType , DecimalDType , Nullability } ;
13+ use vortex:: dtype:: DType ;
14+ use vortex:: dtype:: DecimalDType ;
15+ use vortex:: dtype:: Nullability ;
1216use vortex:: file:: WriteOptionsSessionExt ;
1317use vortex:: io:: runtime:: current:: CurrentThreadRuntime ;
1418use vortex:: io:: runtime:: BlockingRuntime ;
@@ -32,7 +36,9 @@ use vortex::VortexSessionDefault;
3236/// | John | 10000 | VA |
3337fn main ( ) {
3438 let runtime = CurrentThreadRuntime :: new ( ) ;
35- let session = VortexSession :: default ( ) . with_handle ( runtime. handle ( ) ) ;
39+ let session = VortexSession :: new_with_defaults ( )
40+ . with_handle ( runtime. handle ( ) )
41+ . freeze ( ) ;
3642
3743 let mut names = VarBinViewBuilder :: with_capacity ( DType :: Utf8 ( Nullability :: NonNullable ) , 10 ) ;
3844 names. append_value ( "Alice" ) ;
Original file line number Diff line number Diff line change @@ -65,9 +65,11 @@ impl VortexSession {
6565 ///
6666 /// Note that the returned value internally holds a lock on the variable.
6767 pub fn get_mut < V : SessionVar + Default > ( & mut self ) -> & mut V {
68- self . 0
68+ let v = self
69+ . 0
6970 . entry ( TypeId :: of :: < V > ( ) )
70- . or_insert_with ( || Box :: new ( V :: default ( ) ) )
71+ . or_insert_with ( || Box :: new ( V :: default ( ) ) ) ;
72+ ( * * v)
7173 . as_any_mut ( )
7274 . downcast_mut :: < V > ( )
7375 . vortex_expect ( "Type mismatch - this is a bug" )
Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ impl VortexSessionDefault for VortexSession {
157157 VortexSession :: empty ( ) . with_defaults ( )
158158 }
159159
160+ #[ allow( unused_mut) ]
160161 fn with_defaults ( self ) -> VortexSession {
161162 let mut this = self
162163 . with :: < VortexMetrics > ( )
You can’t perform that action at this time.
0 commit comments