Apply review suggestions

This commit is contained in:
Loïc Lecrenier 2023-01-11 14:31:34 +01:00 committed by Tamo
parent c91ffec72e
commit b0b7ad7caf
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
12 changed files with 236 additions and 251 deletions

View file

@ -33,8 +33,7 @@ impl AuthController {
Ok(Self { store: Arc::new(store), master_key: master_key.clone() })
}
pub fn create_key(&self, value: CreateApiKey) -> Result<Key> {
let create_key = value;
pub fn create_key(&self, create_key: CreateApiKey) -> Result<Key> {
match self.store.get_api_key(create_key.uid)? {
Some(_) => Err(AuthControllerError::ApiKeyAlreadyExists(create_key.uid.to_string())),
None => self.store.put_api_key(create_key.to_key()),