File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
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
You can’t perform that action at this time.
0 commit comments