mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Apply review suggestions
This commit is contained in:
parent
c91ffec72e
commit
b0b7ad7caf
12 changed files with 236 additions and 251 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue