Skip to content

Commit

Permalink
Address PR feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Isaev committed Jan 15, 2025
1 parent 5e7caf2 commit ab8a3fb
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions mountpoint-s3-client/src/s3_crt_client/copy_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ use std::ops::Deref;
use std::os::unix::prelude::OsStrExt;
use tracing::trace;
use mountpoint_s3_crt::{http::request_response::Header, s3::client::MetaRequestResult};

Check warning on line 4 in mountpoint-s3-client/src/s3_crt_client/copy_object.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3-client/src/s3_crt_client/copy_object.rs
use crate::endpoint_config::EndpointError;
use crate::object_client::{CopyObjectError, CopyObjectParams, CopyObjectResult, ObjectClientResult};
use crate::s3_crt_client::{ConstructionError, S3CrtClient, S3CrtClientInner, S3Operation, S3RequestError};

impl From<EndpointError> for S3RequestError {
fn from(error: EndpointError) -> Self {
S3RequestError::ConstructionFailure(ConstructionError::InvalidEndpoint(error))
}
}

impl S3CrtClient {
/// Create and begin a new CopyObject request.
pub(super) async fn copy_object(
Expand Down Expand Up @@ -47,12 +40,11 @@ impl S3CrtClient {
);

Check warning on line 40 in mountpoint-s3-client/src/s3_crt_client/copy_object.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3-client/src/s3_crt_client/copy_object.rs

let mut options = S3CrtClientInner::new_meta_request_options(message, S3Operation::CopyObject);
let endpoint = self.inner.endpoint_config.resolve_for_bucket(source_bucket)
.map_err(|e| S3RequestError::from(e))?;
let uri = endpoint.uri()
.map_err(|e| S3RequestError::from(e))?
.as_os_str();
let source_uri = format!("{uri}/{source_key}");
let uri = self.inner.endpoint_config.resolve_for_bucket(source_bucket)
.map_err(|e| S3RequestError::from(ConstructionError::from(e)))?
.uri()
.map_err(|e| S3RequestError::from(ConstructionError::from(e)))?;
let source_uri = format!("{}/{source_key}", uri.as_os_str().to_string_lossy());

Check warning on line 47 in mountpoint-s3-client/src/s3_crt_client/copy_object.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3-client/src/s3_crt_client/copy_object.rs
trace!(source_uri, "resolved source uri");
options.copy_source_uri(&source_uri);
self.inner.make_simple_http_request_from_options(options, span, |_| {}, parse_copy_object_error, |_, _| ())?
Expand Down

0 comments on commit ab8a3fb

Please sign in to comment.