File tree Expand file tree Collapse file tree 4 files changed +9
-11
lines changed
Expand file tree Collapse file tree 4 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,14 @@ use raphtory_api::core::entities::properties::prop::Prop;
55use parking_lot:: { RwLockReadGuard , RwLockWriteGuard } ;
66use crate :: segments:: graph:: segment:: MemGraphSegment ;
77use raphtory_api:: core:: entities:: properties:: tprop:: TPropOps ;
8- use std:: path:: PathBuf ;
98
109pub trait GraphSegmentOps : Send + Sync + Debug + ' static
1110where
1211 Self : Sized ,
1312{
1413 type Entry < ' a > : GraphEntryOps < ' a > ;
1514
16- fn new ( path : Option < PathBuf > ) -> Self ;
15+ fn new ( path : Option < & Path > ) -> Self ;
1716
1817 fn load ( path : impl AsRef < Path > ) -> Result < Self , StorageError > ;
1918
Original file line number Diff line number Diff line change @@ -23,24 +23,24 @@ pub struct GraphStorageInner<GS, EXT> {
2323}
2424
2525impl < GS : GraphSegmentOps , EXT : Config > GraphStorageInner < GS , EXT > {
26- pub fn new ( path : Option < PathBuf > , ext : EXT ) -> Self {
27- let page = Arc :: new ( GS :: new ( path. clone ( ) ) ) ;
26+ pub fn new ( path : Option < & Path > , ext : EXT ) -> Self {
27+ let page = Arc :: new ( GS :: new ( path) ) ;
2828 let graph_meta = Arc :: new ( GraphMeta :: new ( ) ) ;
2929
3030 Self {
3131 page,
32- path,
32+ path : path . map ( |p| p . to_path_buf ( ) ) ,
3333 graph_meta,
3434 ext,
3535 }
3636 }
3737
38- pub fn new_with_meta ( path : Option < PathBuf > , graph_meta : Arc < GraphMeta > , ext : EXT ) -> Self {
39- let page = Arc :: new ( GS :: new ( path. clone ( ) ) ) ;
38+ pub fn new_with_meta ( path : Option < & Path > , graph_meta : Arc < GraphMeta > , ext : EXT ) -> Self {
39+ let page = Arc :: new ( GS :: new ( path) ) ;
4040
4141 Self {
4242 page,
43- path,
43+ path : path . map ( |p| p . to_path_buf ( ) ) ,
4444 graph_meta,
4545 ext,
4646 }
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ impl<
182182 ext. clone ( ) ,
183183 ) ) ;
184184 let graph_storage = Arc :: new ( GraphStorageInner :: new_with_meta (
185- graph_path,
185+ graph_path. as_deref ( ) ,
186186 graph_meta,
187187 ext. clone ( ) ,
188188 ) ) ;
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use crate::error::StorageError;
1010use crate :: segments:: graph:: segment:: MemGraphSegment ;
1111use crate :: segments:: graph:: entry:: MemGraphEntry ;
1212use parking_lot:: { RwLockReadGuard , RwLockWriteGuard } ;
13- use std:: path:: PathBuf ;
1413
1514/// `GraphSegmentView` manages graph temporal properties and graph metadata
1615/// (constant properties). Reads / writes are always served from the in-memory segment.
@@ -27,7 +26,7 @@ pub struct GraphSegmentView {
2726impl GraphSegmentOps for GraphSegmentView {
2827 type Entry < ' a > = MemGraphEntry < ' a > ;
2928
30- fn new ( path : Option < PathBuf > ) -> Self {
29+ fn new ( _path : Option < & Path > ) -> Self {
3130 Self {
3231 head : Arc :: new ( RwLock :: new ( MemGraphSegment :: new ( ) ) ) ,
3332 est_size : AtomicUsize :: new ( 0 ) ,
You can’t perform that action at this time.
0 commit comments