Skip to content

Commit

Permalink
refactor: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tu6ge committed Aug 11, 2023
1 parent 8d7f64a commit a13e05e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/auth/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'a> QueryAuth<'a> {
CanonicalizedResource::from_object_str(self.bucket.as_ref(), path.as_ref())
}
fn get_url(&self, path: &ObjectPath) -> Url {
let mut url = url_from_bucket(&self.endpoint, &self.bucket);
let mut url = url_from_bucket(self.endpoint, self.bucket);
url.set_object_path(path);
url
}
Expand All @@ -126,6 +126,7 @@ impl<'a> QueryAuth<'a> {
string
}
fn signature(&self, path: &ObjectPath, expires: i64) -> String {
#![allow(clippy::unwrap_used)]
self.access_secret_key
.encryption_string(self.sign_string(path, expires))
.unwrap()
Expand Down
6 changes: 3 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<M: Clone> Clone for Client<M> {
client_middleware: self.client_middleware.clone(),
endpoint: self.endpoint.clone(),
bucket: self.bucket.clone(),
timeout: self.timeout.clone(),
timeout: self.timeout,
}
}
}
Expand Down Expand Up @@ -194,10 +194,10 @@ impl<M> Client<M> {
}

pub(crate) fn get_key(&self) -> &KeyId {
&self.auth_builder.get_key()
self.auth_builder.get_key()
}
pub(crate) fn get_secret(&self) -> &KeySecret {
&self.auth_builder.get_secret()
self.auth_builder.get_secret()
}

pub(crate) fn get_endpoint(&self) -> &EndPoint {
Expand Down
8 changes: 4 additions & 4 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub mod std_path_impl {
#[oss_gen_rc]
impl GetStdWithPath<String> for ClientArc {
fn get_std_with_path(&self, path: String) -> Option<(Url, CanonicalizedResource)> {
<Self as GetStdWithPath<&str>>::get_std_with_path(&self, &path)
<Self as GetStdWithPath<&str>>::get_std_with_path(self, &path)
}
}

Expand All @@ -264,7 +264,7 @@ pub mod std_path_impl {
#[oss_gen_rc]
impl GetStdWithPath<ObjectPath> for ClientArc {
fn get_std_with_path(&self, path: ObjectPath) -> Option<(Url, CanonicalizedResource)> {
<Self as GetStdWithPath<&ObjectPath>>::get_std_with_path(&self, &path)
<Self as GetStdWithPath<&ObjectPath>>::get_std_with_path(self, &path)
}
}

Expand Down Expand Up @@ -292,7 +292,7 @@ pub mod std_path_impl {
/// 文件路径可以是 `String` 类型
impl<B: AsRef<BucketBase>> GetStdWithPath<String> for B {
fn get_std_with_path(&self, path: String) -> Option<(Url, CanonicalizedResource)> {
<Self as GetStdWithPath<&str>>::get_std_with_path(&self, &path)
<Self as GetStdWithPath<&str>>::get_std_with_path(self, &path)
}
}

Expand All @@ -314,7 +314,7 @@ pub mod std_path_impl {
impl<B: AsRef<BucketBase>> GetStdWithPath<ObjectPath> for B {
#[inline]
fn get_std_with_path(&self, path: ObjectPath) -> Option<(Url, CanonicalizedResource)> {
<Self as GetStdWithPath<&ObjectPath>>::get_std_with_path(&self, &path)
<Self as GetStdWithPath<&ObjectPath>>::get_std_with_path(self, &path)
}
}

Expand Down

0 comments on commit a13e05e

Please sign in to comment.