koushiro commented on code in PR #6765:
URL: https://github.com/apache/opendal/pull/6765#discussion_r2507613167
##########
core/src/services/aliyun_drive/mod.rs:
##########
@@ -16,7 +16,7 @@
// under the License.
/// Default scheme for aliyun_drive service.
-pub const ALIYUN_DRIVE_SCHEME: &str = "aliyun-drive";
+pub const ALIYUN_DRIVE_SCHEME: &str = "aliyun_drive";
Review Comment:
If we plan to remove the `Scheme` enum later and use a unique string as the
scheme, it'd be best to standardize on a certain connector.
The reason some existing CIs haven't encountered errors is that they convert
the connectors as follows,
```rust
/// Init a service with given scheme.
///
/// - Load scheme from `OPENDAL_TEST`
/// - Construct a new Operator with given root.
/// - Else, returns a `None` to represent no valid config for operator.
pub fn init_test_service() -> Result<Option<Operator>> {
let _ = dotenvy::dotenv();
let scheme = if let Ok(v) = env::var("OPENDAL_TEST") {
v
} else {
return Ok(None);
};
let scheme = Scheme::from_str(&scheme).unwrap();
let scheme_key = String::from(scheme).replace('-', "_");
let prefix = format!("opendal_{scheme_key}_");
...
}
```
and the `FromStr` implementation of `Scheme` enum also matches multiple
formats in the following ways:
```rust
impl FromStr for Scheme {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let s = s.to_lowercase();
match s.as_str() {
"aliyun-drive" | "aliyun_drive" => Ok(Scheme::AliyunDrive),
...
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]