Xuanwo commented on code in PR #5960:
URL: https://github.com/apache/opendal/pull/5960#discussion_r2029869379
##########
core/src/types/metadata.rs:
##########
@@ -429,7 +429,7 @@ impl Metadata {
}
/// Set user defined metadata of this entry
- pub fn with_user_metadata(&mut self, data: HashMap<String, String>) ->
&mut Self {
+ pub fn set_user_metadata(&mut self, data: HashMap<String, String>) -> &mut
Self {
Review Comment:
The difference between `with_xxx` and `set_xxx` is:
- `with_xxx` accepts an owned type, requiring no `Copy` or `Clone`, but it
consumes `self`.
- `set_xxx` accepts a borrowed type, which may require an additional clone,
but only needs `&mut self`.
The current API sits somewhere in between these two approaches. It might be
better to change it to `with_user_metadata(mut self, data)` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]