Skip to content

Commit 9cc22d9

Browse files
authored
feat: Bump opendal to 0.48.0 (#2240)
Signed-off-by: Xuanwo <[email protected]>
1 parent 29d17c7 commit 9cc22d9

File tree

10 files changed

+115
-159
lines changed

10 files changed

+115
-159
lines changed

Cargo.lock

Lines changed: 45 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ mime = "0.3"
6464
num_cpus = "1.16"
6565
number_prefix = "0.4"
6666
once_cell = "1.19"
67-
opendal = { version = "0.47.3", optional = true, default-features = false }
67+
opendal = { version = "0.48.0", optional = true, default-features = false }
6868
openssl = { version = "0.10.64", optional = true }
6969
rand = "0.8.4"
7070
regex = "1.10.3"
71-
reqsign = { version = "0.15.2", optional = true }
71+
reqsign = { version = "0.16.0", optional = true }
7272
reqwest = { version = "0.12", features = [
7373
"json",
7474
"blocking",

src/cache/azure.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pub struct AzureBlobCache;
2424

2525
impl AzureBlobCache {
2626
pub fn build(connection_string: &str, container: &str, key_prefix: &str) -> Result<Operator> {
27-
let mut builder = Azblob::from_connection_string(connection_string)?;
28-
builder.container(container);
29-
builder.root(key_prefix);
27+
let builder = Azblob::from_connection_string(connection_string)?
28+
.container(container)
29+
.root(key_prefix);
3030

3131
let op = Operator::new(builder)?
3232
.layer(LoggingLayer::default())

src/cache/gcs.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,24 @@ impl GCSCache {
4242
rw_mode: CacheMode,
4343
credential_url: Option<&str>,
4444
) -> Result<Operator> {
45-
let mut builder = Gcs::default();
46-
builder.bucket(bucket);
47-
builder.root(key_prefix);
48-
builder.scope(rw_to_scope(rw_mode));
45+
let mut builder = Gcs::default()
46+
.bucket(bucket)
47+
.root(key_prefix)
48+
.scope(rw_to_scope(rw_mode));
4949

5050
if let Some(service_account) = service_account {
51-
builder.service_account(service_account);
51+
builder = builder.service_account(service_account);
5252
}
5353

5454
if let Some(path) = cred_path {
55-
builder.credential_path(path);
55+
builder = builder.credential_path(path);
5656
}
5757

5858
if let Some(cred_url) = credential_url {
5959
let _ = Url::parse(cred_url)
6060
.map_err(|err| anyhow!("gcs credential url is invalid: {err:?}"))?;
6161

62-
builder.customed_token_loader(Box::new(TaskClusterTokenLoader {
62+
builder = builder.customized_token_loader(Box::new(TaskClusterTokenLoader {
6363
scope: rw_to_scope(rw_mode).to_string(),
6464
url: cred_url.to_string(),
6565
}));

src/cache/gha.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ pub struct GHACache;
2424

2525
impl GHACache {
2626
pub fn build(version: &str) -> Result<Operator> {
27-
let mut builder = Ghac::default();
28-
// This is the prefix of gha cache.
29-
// From user side, cache key will be like `sccache/f/c/b/fcbxxx`
30-
//
31-
// User customization is theoretically supported, but I decided
32-
// to see the community feedback first.
33-
builder.root("/sccache");
27+
let mut builder = Ghac::default()
28+
// This is the prefix of gha cache.
29+
// From user side, cache key will be like `sccache/f/c/b/fcbxxx`
30+
//
31+
// User customization is theoretically supported, but I decided
32+
// to see the community feedback first.
33+
.root("/sccache");
3434

35-
if version.is_empty() {
36-
builder.version(&format!("sccache-v{VERSION}"));
35+
builder = if version.is_empty() {
36+
builder.version(&format!("sccache-v{VERSION}"))
3737
} else {
38-
builder.version(&format!("sccache-v{VERSION}-{version}"));
39-
}
38+
builder.version(&format!("sccache-v{VERSION}-{version}"))
39+
};
4040

4141
let op = Operator::new(builder)?
4242
.layer(LoggingLayer::default())

0 commit comments

Comments
 (0)