crepererum commented on code in PR #669:
URL:
https://github.com/apache/arrow-rs-object-store/pull/669#discussion_r2961043460
##########
src/aws/builder.rs:
##########
@@ -679,7 +679,13 @@ impl AmazonS3Builder {
self.conditional_put = ConfigValue::Deferred(value.into())
}
AmazonS3ConfigKey::RequestPayer => {
- self.request_payer = ConfigValue::Deferred(value.into())
+ // Support the standard AWS value "requester" as a boolean true
Review Comment:
I would probably use a new-type wrapper for that, like:
```rust
// derive whatever you need, but basically this is just a `bool`
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash]
struct RequesterPayer(bool);
impl Parse for RequesterPayer {
fn parse(v: &str) -> Result<Self> {
if v.eq_ignore_ascii_case("requester") {
Ok(Self(true))
} else {
Ok(Self(bool::parse(v)?))
}
}
}
// you may want to implement a few convenience traits
impl From<RequesterPayer> for bool {...}
impl AsRef<bool> for RequesterPayer {...}
impl Deref for RequesterPayer {...}
```
--
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]