You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "yihong0618 (via GitHub)" <gi...@apache.org> on 2025/01/17 06:05:25 UTC
[PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
yihong0618 opened a new pull request, #5561:
URL: https://github.com/apache/opendal/pull/5561
also fix to clippy warning
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!---
If there are any breaking changes to public APIs, please add the `breaking-changes` label.
-->
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919611959
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
yes, I checked the code, that's why ignore clippy here
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919613877
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
more info:
without the ignore

--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919616783
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
> It seems you are not using the stable version of Rust to run Clippy. I believe we don't need to add this at the current stage.
OK copy that, will drop this
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919610632
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
Hi, it's not a formatting_args, `{region}` is the raw content.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #5561:
URL: https://github.com/apache/opendal/pull/5561
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919614538
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
It seems you are not using the stable version of Rust to run Clippy. I believe we don't need to add this at the current stage.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919617742
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
dropped
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919622251
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
Related to https://github.com/rust-lang/rust-clippy/issues/13989
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "yihong0618 (via GitHub)" <gi...@apache.org>.
yihong0618 commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919623055
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
cool
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor: refactor all body.copy_to_bytes(body.remaining()) [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #5561:
URL: https://github.com/apache/opendal/pull/5561#discussion_r1919615638
##########
core/src/services/s3/backend.rs:
##########
@@ -512,6 +512,7 @@ impl S3Builder {
// Update with endpoint templates.
endpoint = if let Some(template) = ENDPOINT_TEMPLATES.get(endpoint.as_str()) {
+ #[allow(clippy::literal_string_with_formatting_args)]
template.replace("{region}", region)
Review Comment:
In that case, it's a false positive. Perhaps we could raise an issue with Clippy instead. `std::replace()` takes a `Pattern` instead of a `format_args()`, it doesn't make sense to check this here.
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org