|
17 | 17 |
|
18 | 18 | use std::future::Future; |
19 | 19 | use std::pin::Pin; |
20 | | -#[cfg(any( |
21 | | - feature = "storage-s3", |
22 | | - feature = "storage-gcs", |
23 | | - feature = "storage-oss", |
24 | | - feature = "storage-azdls", |
25 | | -))] |
26 | 20 | use std::sync::Arc; |
27 | 21 |
|
28 | 22 | use opendal::layers::RetryLayer; |
@@ -150,10 +144,32 @@ impl Storage { |
150 | 144 | } |
151 | 145 | } |
152 | 146 | // Update doc on [`FileIO`] when adding new schemes. |
| 147 | + #[cfg(not(any( |
| 148 | + feature = "storage-memory", |
| 149 | + feature = "storage-fs", |
| 150 | + feature = "storage-s3", |
| 151 | + feature = "storage-gcs", |
| 152 | + feature = "storage-oss", |
| 153 | + feature = "storage-azdls" |
| 154 | + )))] |
153 | 155 | _ => { |
154 | 156 | return Err(Error::new( |
155 | 157 | ErrorKind::FeatureUnsupported, |
156 | | - format!("Constructing file io from scheme: {scheme} not supported now",), |
| 158 | + "No storage service has been enabled".to_string(), |
| 159 | + )); |
| 160 | + } |
| 161 | + #[cfg(any( |
| 162 | + feature = "storage-memory", |
| 163 | + feature = "storage-fs", |
| 164 | + feature = "storage-s3", |
| 165 | + feature = "storage-gcs", |
| 166 | + feature = "storage-oss", |
| 167 | + feature = "storage-azdls" |
| 168 | + ))] |
| 169 | + _ => { |
| 170 | + return Err(Error::new( |
| 171 | + ErrorKind::FeatureUnsupported, |
| 172 | + format!("Constructing file io from scheme: {scheme} not supported now"), |
157 | 173 | )); |
158 | 174 | } |
159 | 175 | }; |
|
0 commit comments