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> {
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
You can’t perform that action at this time.
0 commit comments