You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/10/24 11:40:42 UTC
(opendal) branch fix-list-with-version created (now 36aea3abbd)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a change to branch fix-list-with-version
in repository https://gitbox.apache.org/repos/asf/opendal.git
at 36aea3abbd fix(integration/compat): Fix opendal 0.50 OpList has new field
This branch includes the following new commits:
new 36aea3abbd fix(integration/compat): Fix opendal 0.50 OpList has new field
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(opendal) 01/01: fix(integration/compat): Fix opendal 0.50 OpList has new field
Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch fix-list-with-version
in repository https://gitbox.apache.org/repos/asf/opendal.git
commit 36aea3abbd54b36585f4c6a47e449aa7adf6dd58
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Thu Oct 24 19:40:10 2024 +0800
fix(integration/compat): Fix opendal 0.50 OpList has new field
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
integrations/compat/src/v0_50_to_v0_49.rs | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/integrations/compat/src/v0_50_to_v0_49.rs b/integrations/compat/src/v0_50_to_v0_49.rs
index fea3744b0d..7810d69905 100644
--- a/integrations/compat/src/v0_50_to_v0_49.rs
+++ b/integrations/compat/src/v0_50_to_v0_49.rs
@@ -345,6 +345,7 @@ impl<I: opendal_v0_50::raw::oio::BlockingList> opendal_v0_49::raw::oio::Blocking
/// `transmute` also perform compile time checks to detect any type size mismatch like `OpWrite`
/// in which we added a new field since v0.50.
mod convert {
+ use opendal_v0_50::Metakey;
use std::mem::transmute;
pub fn error_into(e: opendal_v0_50::Error) -> opendal_v0_49::Error {
@@ -474,8 +475,28 @@ mod convert {
unsafe { transmute(e) }
}
+ /// OpenDAL v0.50's OpList has a new field `version`.
pub fn raw_op_list_from(e: opendal_v0_49::raw::OpList) -> opendal_v0_50::raw::OpList {
- unsafe { transmute(e) }
+ let mut op = opendal_v0_50::raw::OpList::new();
+
+ if let Some(v) = e.limit() {
+ op = op.with_limit(v);
+ }
+
+ if let Some(v) = e.start_after() {
+ op = op.with_start_after(v);
+ }
+
+ if e.recursive() {
+ op = op.with_recursive(true);
+ }
+
+ // There is no way for us to convert `metakey` without depending on `flagset`,
+ // let's just hardcode them.
+ op = op.with_metakey(Metakey::Mode | Metakey::LastModified);
+ op = op.with_concurrent(e.concurrent());
+
+ op
}
pub fn raw_rp_list_into(e: opendal_v0_50::raw::RpList) -> opendal_v0_49::raw::RpList {