This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 229bf8b614 ObjectStore Wasm32 Fixes (#4775) (#4776) (#4796)
229bf8b614 is described below

commit 229bf8b6148e5a134df85b41ca4e6d10583cf1db
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Thu Sep 14 10:21:50 2023 +0100

    ObjectStore Wasm32 Fixes (#4775) (#4776) (#4796)
---
 .github/workflows/object_store.yml |  2 ++
 object_store/README.md             |  2 +-
 object_store/src/client/mod.rs     |  3 ++-
 object_store/src/lib.rs            | 18 +++++++++---------
 object_store/src/parse.rs          |  2 +-
 5 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/object_store.yml 
b/.github/workflows/object_store.yml
index 3b9b1e31d5..c28f8037a3 100644
--- a/.github/workflows/object_store.yml
+++ b/.github/workflows/object_store.yml
@@ -60,6 +60,8 @@ jobs:
         run: cargo clippy --features gcp -- -D warnings
       - name: Run clippy with azure feature
         run: cargo clippy --features azure -- -D warnings
+      - name: Run clippy with http feature
+        run: cargo clippy --features http -- -D warnings
       - name: Run clippy with all features
         run: cargo clippy --all-features -- -D warnings
       - name: Run clippy with all features and all targets
diff --git a/object_store/README.md b/object_store/README.md
index 5b47a65c12..fd09ec7205 100644
--- a/object_store/README.md
+++ b/object_store/README.md
@@ -39,7 +39,7 @@ See [docs.rs](https://docs.rs/object_store) for usage 
instructions
 
 ## Support for `wasm32-unknown-unknown` target
 
-It's possible to build `object_store` for the `wasm32-unknown-unknown` target, 
however the cloud storage features `aws`, `azure`, and `gcp` are not supported.
+It's possible to build `object_store` for the `wasm32-unknown-unknown` target, 
however the cloud storage features `aws`, `azure`, `gcp`, and `http` are not 
supported.
 
 ```
 cargo build -p object_store --target wasm32-unknown-unknown
diff --git a/object_store/src/client/mod.rs b/object_store/src/client/mod.rs
index d4995a5b14..77b14a7587 100644
--- a/object_store/src/client/mod.rs
+++ b/object_store/src/client/mod.rs
@@ -18,6 +18,7 @@
 //! Generic utilities reqwest based ObjectStore implementations
 
 pub mod backoff;
+
 #[cfg(test)]
 pub mod mock_server;
 
@@ -35,7 +36,6 @@ pub mod list;
 #[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))]
 pub mod token;
 
-#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))]
 pub mod header;
 
 #[cfg(any(feature = "aws", feature = "gcp"))]
@@ -575,6 +575,7 @@ pub struct StaticCredentialProvider<T> {
 }
 
 impl<T> StaticCredentialProvider<T> {
+    /// A [`CredentialProvider`] for a static credential of type `T`
     pub fn new(credential: T) -> Self {
         Self {
             credential: Arc::new(credential),
diff --git a/object_store/src/lib.rs b/object_store/src/lib.rs
index 413b400395..8d96ccf1df 100644
--- a/object_store/src/lib.rs
+++ b/object_store/src/lib.rs
@@ -240,9 +240,9 @@
 
 #[cfg(all(
     target_arch = "wasm32",
-    any(feature = "gcp", feature = "aws", feature = "azure",)
+    any(feature = "gcp", feature = "aws", feature = "azure", feature = "http")
 ))]
-compile_error!("Features 'gcp', 'aws', 'azure' are not supported on wasm.");
+compile_error!("Features 'gcp', 'aws', 'azure', 'http' are not supported on 
wasm.");
 
 #[cfg(feature = "aws")]
 pub mod aws;
@@ -263,13 +263,16 @@ pub mod path;
 pub mod prefix;
 pub mod throttle;
 
-#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = 
"http"))]
+#[cfg(feature = "cloud")]
 mod client;
 
-#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = 
"http"))]
-pub use client::{backoff::BackoffConfig, retry::RetryConfig, 
CredentialProvider};
+#[cfg(feature = "cloud")]
+pub use client::{
+    backoff::BackoffConfig, retry::RetryConfig, ClientConfigKey, ClientOptions,
+    CredentialProvider, StaticCredentialProvider,
+};
 
-#[cfg(any(feature = "gcp", feature = "aws", feature = "azure", feature = 
"http"))]
+#[cfg(feature = "cloud")]
 mod config;
 
 #[cfg(feature = "cloud")]
@@ -295,9 +298,6 @@ use std::ops::Range;
 use std::sync::Arc;
 use tokio::io::AsyncWrite;
 
-#[cfg(any(feature = "azure", feature = "aws", feature = "gcp", feature = 
"http"))]
-pub use client::{ClientConfigKey, ClientOptions};
-
 /// An alias for a dynamically dispatched object store implementation.
 pub type DynObjectStore = dyn ObjectStore;
 
diff --git a/object_store/src/parse.rs b/object_store/src/parse.rs
index 7b89e58e10..1159e9a1af 100644
--- a/object_store/src/parse.rs
+++ b/object_store/src/parse.rs
@@ -104,7 +104,7 @@ impl ObjectStoreScheme {
     }
 }
 
-#[cfg(any(feature = "aws", feature = "gcp", feature = "azure", feature = 
"http"))]
+#[cfg(any(feature = "aws", feature = "gcp", feature = "azure"))]
 macro_rules! builder_opts {
     ($builder:ty, $url:expr, $options:expr) => {{
         let builder = $options.into_iter().fold(

Reply via email to