This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new e2b179475 chore: no need Error::map method (#7110)
e2b179475 is described below
commit e2b1794754bbe2851711f958a1148657b1094895
Author: tison <[email protected]>
AuthorDate: Mon Dec 29 13:08:54 2025 +0800
chore: no need Error::map method (#7110)
Signed-off-by: tison <[email protected]>
---
core/core/src/types/error.rs | 8 --------
core/services/ghac/src/core.rs | 4 +---
core/services/ghac/src/writer.rs | 2 +-
3 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/core/core/src/types/error.rs b/core/core/src/types/error.rs
index 87c90921c..2639b9e1b 100644
--- a/core/core/src/types/error.rs
+++ b/core/core/src/types/error.rs
@@ -368,14 +368,6 @@ impl Error {
self
}
- /// Operate on error with map.
- pub fn map<F>(self, f: F) -> Self
- where
- F: FnOnce(Self) -> Self,
- {
- f(self)
- }
-
/// Set permanent status for error.
///
/// By set permanent, we indicate the retry must be stopped.
diff --git a/core/services/ghac/src/core.rs b/core/services/ghac/src/core.rs
index 5effb1bea..d04112441 100644
--- a/core/services/ghac/src/core.rs
+++ b/core/services/ghac/src/core.rs
@@ -243,9 +243,7 @@ impl GhacCore {
.map_err(new_json_deserialize_error)?;
reserve_resp.cache_id
} else {
- return Err(
- parse_error(resp).map(|err|
err.with_operation("Backend::ghac_reserve"))
- );
+ return
Err(parse_error(resp).with_operation("Backend::ghac_reserve"));
};
let url = format!("{}{CACHE_URL_BASE}/caches/{cache_id}",
self.cache_url);
diff --git a/core/services/ghac/src/writer.rs b/core/services/ghac/src/writer.rs
index d6b4f4692..bf9a2e515 100644
--- a/core/services/ghac/src/writer.rs
+++ b/core/services/ghac/src/writer.rs
@@ -165,7 +165,7 @@ impl oio::Write for GhacWriterV1 {
let resp = self.core.ghac_v1_write(&self.url, size, offset, bs).await?;
if !resp.status().is_success() {
- return Err(parse_error(resp).map(|err|
err.with_operation("Backend::ghac_upload")));
+ return
Err(parse_error(resp).with_operation("Backend::ghac_upload"));
}
self.size += size;
Ok(())