File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -153,27 +153,30 @@ impl<S: crate::store::Store> Builder<S> {
153153 }
154154}
155155
156- impl Blobs < crate :: store :: mem :: Store > {
157- /// Create a new memory-backed Blobs protocol handler.
158- pub fn memory ( ) -> Builder < crate :: store :: mem :: Store > {
156+ impl < S > Blobs < S > {
157+ /// Create a new Blobs protocol handler builder, given a store .
158+ pub fn builder ( store : S ) -> Builder < S > {
159159 Builder {
160- store : crate :: store :: mem :: Store :: new ( ) ,
160+ store,
161161 events : None ,
162162 gc_config : None ,
163163 }
164164 }
165165}
166166
167+ impl Blobs < crate :: store:: mem:: Store > {
168+ /// Create a new memory-backed Blobs protocol handler.
169+ pub fn memory ( ) -> Builder < crate :: store:: mem:: Store > {
170+ Self :: builder ( crate :: store:: mem:: Store :: new ( ) )
171+ }
172+ }
173+
167174impl Blobs < crate :: store:: fs:: Store > {
168175 /// Load a persistent Blobs protocol handler from a path.
169176 pub async fn persistent (
170177 path : impl AsRef < std:: path:: Path > ,
171178 ) -> anyhow:: Result < Builder < crate :: store:: fs:: Store > > {
172- Ok ( Builder {
173- store : crate :: store:: fs:: Store :: load ( path) . await ?,
174- events : None ,
175- gc_config : None ,
176- } )
179+ Ok ( Self :: builder ( crate :: store:: fs:: Store :: load ( path) . await ?) )
177180 }
178181}
179182
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ pub(super) struct ReadOnlyTables {
8383 pub inline_outboard : redb:: ReadOnlyTable < Hash , & ' static [ u8 ] > ,
8484}
8585
86- impl < ' txn > ReadOnlyTables {
87- pub fn new ( tx : & ' txn redb:: ReadTransaction ) -> std:: result:: Result < Self , TableError > {
86+ impl ReadOnlyTables {
87+ pub fn new ( tx : & redb:: ReadTransaction ) -> std:: result:: Result < Self , TableError > {
8888 Ok ( Self {
8989 blobs : tx. open_table ( BLOBS_TABLE ) ?,
9090 tags : tx. open_table ( TAGS_TABLE ) ?,
You can’t perform that action at this time.
0 commit comments