Skip to content

Commit 1c4a82d

Browse files
aawsomesimonsan
andauthored
deps: update opendal to 0.46 and refactor accordingly (#225)
Co-authored-by: simonsan <[email protected]>
1 parent 3eeb42f commit 1c4a82d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/backend/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ tokio = { version = "1.36.0", optional = true, default-features = false }
8888

8989
[target.'cfg(not(windows))'.dependencies]
9090
# opendal backend - sftp is not supported on windows, see https://github.com/apache/incubator-opendal/issues/2963
91-
opendal = { version = "0.45", features = ["services-b2", "services-sftp", "services-swift", "layers-blocking", "layers-throttle"], optional = true }
91+
opendal = { version = "0.46", features = ["services-b2", "services-sftp", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true }
9292

9393
[target.'cfg(windows)'.dependencies]
9494
# opendal backend
95-
opendal = { version = "0.45", features = ["services-b2", "services-swift", "layers-blocking", "layers-throttle"], optional = true }
95+
opendal = { version = "0.46", features = ["services-b2", "services-swift", "services-azblob", "services-azdls", "services-cos", "services-fs", "services-gcs", "services-ghac", "services-http", "services-ipmfs", "services-memory", "services-obs", "services-oss", "services-s3", "services-webdav", "services-webhdfs", "services-azfile", "layers-blocking", "layers-throttle"], optional = true }
9696

9797
[dev-dependencies]
9898
rstest = { workspace = true }

crates/backend/src/opendal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl ReadBackend for OpenDALBackend {
213213
fn read_full(&self, tpe: FileType, id: &Id) -> Result<Bytes> {
214214
trace!("reading tpe: {tpe:?}, id: {id}");
215215

216-
Ok(self.operator.read(&self.path(tpe, id))?.into())
216+
Ok(self.operator.read(&self.path(tpe, id))?.to_bytes())
217217
}
218218

219219
fn read_partial(
@@ -231,7 +231,7 @@ impl ReadBackend for OpenDALBackend {
231231
.read_with(&self.path(tpe, id))
232232
.range(range)
233233
.call()?
234-
.into())
234+
.to_bytes())
235235
}
236236
}
237237

0 commit comments

Comments
 (0)