File tree 2 files changed +14
-11
lines changed
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> {
153
153
}
154
154
}
155
155
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 > {
159
159
Builder {
160
- store : crate :: store :: mem :: Store :: new ( ) ,
160
+ store,
161
161
events : None ,
162
162
gc_config : None ,
163
163
}
164
164
}
165
165
}
166
166
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
+
167
174
impl Blobs < crate :: store:: fs:: Store > {
168
175
/// Load a persistent Blobs protocol handler from a path.
169
176
pub async fn persistent (
170
177
path : impl AsRef < std:: path:: Path > ,
171
178
) -> 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 ?) )
177
180
}
178
181
}
179
182
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ pub(super) struct ReadOnlyTables {
83
83
pub inline_outboard : redb:: ReadOnlyTable < Hash , & ' static [ u8 ] > ,
84
84
}
85
85
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 > {
88
88
Ok ( Self {
89
89
blobs : tx. open_table ( BLOBS_TABLE ) ?,
90
90
tags : tx. open_table ( TAGS_TABLE ) ?,
You can’t perform that action at this time.
0 commit comments