@@ -64,9 +64,9 @@ impl Bucket<'_> {
6464#[ derive( Debug , Clone ) ]
6565pub enum ObjectStoreBuilder {
6666 /// AWS s3 builder
67- S3 ( AmazonS3Builder ) ,
67+ S3 ( Box < AmazonS3Builder > ) ,
6868 /// Google Cloud Storage builder
69- GCS ( GoogleCloudStorageBuilder ) ,
69+ GCS ( Box < GoogleCloudStorageBuilder > ) ,
7070 /// Filesystem builder
7171 Filesystem ( Arc < LocalFileSystem > ) ,
7272 /// In memory builder
@@ -99,11 +99,11 @@ impl FromStr for ConfigKey {
9999impl ObjectStoreBuilder {
100100 /// Create new AWS S3 Object Store builder
101101 pub fn s3 ( ) -> Self {
102- ObjectStoreBuilder :: S3 ( AmazonS3Builder :: from_env ( ) )
102+ ObjectStoreBuilder :: S3 ( Box :: new ( AmazonS3Builder :: from_env ( ) ) )
103103 }
104104 /// Create new AWS S3 Object Store builder
105105 pub fn gcs ( ) -> Self {
106- ObjectStoreBuilder :: GCS ( GoogleCloudStorageBuilder :: from_env ( ) )
106+ ObjectStoreBuilder :: GCS ( Box :: new ( GoogleCloudStorageBuilder :: from_env ( ) ) )
107107 }
108108 /// Create a new FileSystem ObjectStoreBuilder
109109 pub fn filesystem ( prefix : impl AsRef < Path > ) -> Self {
@@ -117,10 +117,10 @@ impl ObjectStoreBuilder {
117117 pub fn with_config ( self , key : ConfigKey , value : impl Into < String > ) -> Self {
118118 match ( self , key) {
119119 ( ObjectStoreBuilder :: S3 ( aws) , ConfigKey :: AWS ( key) ) => {
120- ObjectStoreBuilder :: S3 ( aws. with_config ( key, value) )
120+ ObjectStoreBuilder :: S3 ( Box :: new ( aws. with_config ( key, value) ) )
121121 }
122122 ( ObjectStoreBuilder :: GCS ( gcs) , ConfigKey :: GCS ( key) ) => {
123- ObjectStoreBuilder :: GCS ( gcs. with_config ( key, value) )
123+ ObjectStoreBuilder :: GCS ( Box :: new ( gcs. with_config ( key, value) ) )
124124 }
125125 ( x, _) => x,
126126 }
@@ -129,15 +129,15 @@ impl ObjectStoreBuilder {
129129 pub fn build ( & self , bucket : Bucket ) -> Result < Arc < dyn ObjectStore > , Error > {
130130 match ( bucket, self ) {
131131 ( Bucket :: S3 ( bucket) , Self :: S3 ( builder) ) => Ok :: < _ , Error > ( Arc :: new (
132- builder
132+ ( * * builder)
133133 . clone ( )
134134 . with_bucket_name ( bucket)
135135 . with_copy_if_not_exists ( S3CopyIfNotExists :: Multipart )
136136 . build ( )
137137 . map_err ( Error :: from) ?,
138138 ) ) ,
139139 ( Bucket :: GCS ( bucket) , Self :: GCS ( builder) ) => Ok :: < _ , Error > ( Arc :: new (
140- builder
140+ ( * * builder)
141141 . clone ( )
142142 . with_bucket_name ( bucket)
143143 . build ( )
0 commit comments