Skip to content

refactor(core/types)!: fix with_user_metadata signature #5960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/services/azblob/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl Access for AzblobBackend {

let user_meta = parse_prefixed_headers(headers, X_MS_META_PREFIX);
if !user_meta.is_empty() {
meta.with_user_metadata(user_meta);
meta = meta.with_user_metadata(user_meta);
}

Ok(RpStat::new(meta))
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/cos/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl Access for CosBackend {

let user_meta = parse_prefixed_headers(headers, "x-cos-meta-");
if !user_meta.is_empty() {
meta.with_user_metadata(user_meta);
meta = meta.with_user_metadata(user_meta);
}

if let Some(v) = parse_header_to_str(headers, constants::X_COS_VERSION_ID)? {
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/gcs/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ impl GcsCore {
m.set_last_modified(parse_datetime_from_rfc3339(&meta.updated)?);

if !meta.metadata.is_empty() {
m.with_user_metadata(meta.metadata);
m = m.with_user_metadata(meta.metadata);
}

Ok(m)
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/obs/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl Access for ObsBackend {
.collect::<HashMap<_, _>>();

if !user_meta.is_empty() {
meta.with_user_metadata(user_meta);
meta = meta.with_user_metadata(user_meta);
}

if let Some(v) = parse_header_to_str(headers, constants::X_OBS_VERSION_ID)? {
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/oss/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl OssCore {
let mut m = parse_into_metadata(path, headers)?;
let user_meta = parse_prefixed_headers(headers, X_OSS_META_PREFIX);
if !user_meta.is_empty() {
m.with_user_metadata(user_meta);
m = m.with_user_metadata(user_meta);
}

Ok(m)
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/s3/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ impl Access for S3Backend {

let user_meta = parse_prefixed_headers(headers, X_AMZ_META_PREFIX);
if !user_meta.is_empty() {
meta.with_user_metadata(user_meta);
meta = meta.with_user_metadata(user_meta);
}

if let Some(v) = parse_header_to_str(headers, X_AMZ_VERSION_ID)? {
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/swift/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl Access for SwiftBackend {
let mut meta = parse_into_metadata(path, headers)?;
let user_meta = parse_prefixed_headers(headers, "x-object-meta-");
if !user_meta.is_empty() {
meta.with_user_metadata(user_meta);
meta = meta.with_user_metadata(user_meta);
}

Ok(RpStat::new(meta))
Expand Down
4 changes: 2 additions & 2 deletions core/src/types/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ impl Metadata {
self.user_metadata.as_ref()
}

/// Set user defined metadata of this entry
pub fn with_user_metadata(&mut self, data: HashMap<String, String>) -> &mut Self {
/// With user defined metadata of this entry
pub fn with_user_metadata(mut self, data: HashMap<String, String>) -> Self {
self.user_metadata = Some(data);
self
}
Expand Down
Loading