suyanhanx commented on code in PR #2803:
URL:
https://github.com/apache/incubator-opendal/pull/2803#discussion_r1285721601
##########
core/tests/behavior/list.rs:
##########
@@ -84,6 +86,95 @@ pub async fn test_list_dir(op: Operator) -> Result<()> {
Ok(())
}
+/// List dir with metakey
+pub async fn test_list_dir_with_metakey(op: Operator) -> Result<()> {
+ let parent = uuid::Uuid::new_v4().to_string();
+ let path = format!("{parent}/{}", uuid::Uuid::new_v4());
+ debug!("Generate a random file: {}", &path);
+ let (content, size) = gen_bytes();
+
+ op.write(&path, content).await.expect("write must succeed");
+
+ let mut obs = op
+ .lister_with(&format!("{parent}/"))
+ .metakey(
+ Metakey::Mode
+ | Metakey::CacheControl
+ | Metakey::ContentDisposition
+ | Metakey::ContentLength
+ | Metakey::ContentMd5
+ | Metakey::ContentRange
+ | Metakey::ContentType
+ | Metakey::Etag
+ | Metakey::LastModified
+ | Metakey::Version,
Review Comment:
We could use like:
```rust
use flagset::{FlagSet, flags};
flags! {
pub enum MetaKey: u64 {
Mode,
Foo,
Bar
}
}
fn main() {
let set: FlagSet<MetaKey> = FlagSet::full();
assert_eq!(MetaKey::Bar | MetaKey::Foo, set & !MetaKey::Mode);
}
```
So,
```rust
let full_set: FlagSet<MetaKey> = FlagSet::full();
```
Then this part could be replaced by `full_set & !MetaKey::Complete`. We
wouldn't have to maintain this place so often.
--
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]