mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-16 16:58:19 +00:00
chore: clean relative to references and borrows
- lint message: the borrowed expression implements the required traits help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#needless_borrows_for_generic_args - lint message: this expression creates a reference which is immediately dereferenced by the compiler help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#needless_borrow - lint message: you don't need to add `&` to all patterns help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#match_ref_pat - remove useless taken reference lint message: needlessly taken reference of left operand help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#op_ref - use &Path instead of &PathBuf as fn parameters lint message: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#ptr_arg
This commit is contained in:
@@ -143,7 +143,7 @@ impl RequestHandler for UpdateAdminTokenRequest {
|
||||
garage: &Arc<Garage>,
|
||||
_admin: &Admin,
|
||||
) -> Result<UpdateAdminTokenResponse, Error> {
|
||||
let mut token = get_existing_admin_token(&garage, &self.id).await?;
|
||||
let mut token = get_existing_admin_token(garage, &self.id).await?;
|
||||
|
||||
apply_token_updates(&mut token, self.body)?;
|
||||
|
||||
@@ -164,7 +164,7 @@ impl RequestHandler for DeleteAdminTokenRequest {
|
||||
garage: &Arc<Garage>,
|
||||
_admin: &Admin,
|
||||
) -> Result<DeleteAdminTokenResponse, Error> {
|
||||
let token = get_existing_admin_token(&garage, &self.id).await?;
|
||||
let token = get_existing_admin_token(garage, &self.id).await?;
|
||||
|
||||
garage
|
||||
.admin_token_table
|
||||
@@ -224,7 +224,7 @@ impl RequestHandler for GetCurrentAdminTokenInfoRequest {
|
||||
}
|
||||
|
||||
let (prefix, _) = self.admin_token.split_once('.').unwrap();
|
||||
let token = get_existing_admin_token(&garage, &prefix.to_string()).await?;
|
||||
let token = get_existing_admin_token(garage, &prefix.to_string()).await?;
|
||||
|
||||
Ok(GetCurrentAdminTokenInfoResponse(admin_token_info_results(
|
||||
&token, now,
|
||||
|
||||
Reference in New Issue
Block a user