clippy: is_some/none/ok/err/empty
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -124,7 +124,7 @@ pub fn create_datastore(param: Value) -> Result<(), Error> {
|
||||
|
||||
let (mut config, _digest) = datastore::config()?;
|
||||
|
||||
if let Some(_) = config.sections.get(&datastore.name) {
|
||||
if config.sections.get(&datastore.name).is_some() {
|
||||
bail!("datastore '{}' already exists.", datastore.name);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ pub fn create_remote(password: String, param: Value) -> Result<(), Error> {
|
||||
|
||||
let (mut config, _digest) = remote::config()?;
|
||||
|
||||
if let Some(_) = config.sections.get(&remote.name) {
|
||||
if config.sections.get(&remote.name).is_some() {
|
||||
bail!("remote '{}' already exists.", remote.name);
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ pub fn create_sync_job(
|
||||
|
||||
let (mut config, _digest) = sync::config()?;
|
||||
|
||||
if let Some(_) = config.sections.get(&sync_job.id) {
|
||||
if config.sections.get(&sync_job.id).is_some() {
|
||||
bail!("job '{}' already exists.", sync_job.id);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ pub fn create_verification_job(
|
||||
|
||||
let (mut config, _digest) = verify::config()?;
|
||||
|
||||
if let Some(_) = config.sections.get(&verification_job.id) {
|
||||
if config.sections.get(&verification_job.id).is_some() {
|
||||
bail!("job '{}' already exists.", verification_job.id);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user