Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge committed Nov 17, 2023
1 parent e0fe144 commit 7539821
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,14 +1212,9 @@ pub fn get_url_resource2<E: AsRef<EndPoint>, B: AsRef<BucketName>>(

pub(crate) fn url_from_bucket(endpoint: &EndPoint, bucket: &BucketName) -> Url {
let url = format!(
"https://{}.oss-{}{}.aliyuncs.com",
"https://{}.oss-{}.aliyuncs.com",
bucket.as_ref(),
endpoint.as_ref(),
if endpoint.is_internal() {
OSS_INTERNAL
} else {
""
}
endpoint.to_string(),
);
url.parse().unwrap_or_else(|_| {
unreachable!("covert to url failed, bucket: {bucket}, endpoint: {endpoint}")
Expand Down

0 comments on commit 7539821

Please sign in to comment.