@@ -355,15 +355,15 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
355
355
}
356
356
357
357
for cert in & doc. certificates {
358
- if entity_names. get ( cert. subject_entity . as_str ( ) ) . is_none ( ) {
358
+ if ! entity_names. contains ( cert. subject_entity . as_str ( ) ) {
359
359
miette:: bail!(
360
360
"certificate \" {}\" subject entity \" {}\" does not exist" ,
361
361
cert. name,
362
362
cert. subject_key
363
363
)
364
364
}
365
365
366
- if kp_names. get ( cert. subject_key . as_str ( ) ) . is_none ( ) {
366
+ if ! kp_names. contains ( cert. subject_key . as_str ( ) ) {
367
367
miette:: bail!(
368
368
"certificate \" {}\" subject key pair \" {}\" does not exist" ,
369
369
cert. name,
@@ -375,7 +375,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
375
375
( None , None ) => miette:: bail!( "certificate \" {}\" must specify either an issuer entity or certificate" , cert. name) ,
376
376
( Some ( _) , Some ( _) ) => miette:: bail!( "certificate \" {}\" specifies both an issuer entity and certificate. Only one may be specified." , cert. name) ,
377
377
( Some ( entity) , None ) => {
378
- if entity_names. get ( entity. as_str ( ) ) . is_none ( ) {
378
+ if ! entity_names. contains ( entity. as_str ( ) ) {
379
379
miette:: bail!(
380
380
"certificate \" {}\" issuer entity \" {}\" does not exist" ,
381
381
cert. name,
@@ -384,7 +384,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
384
384
}
385
385
}
386
386
( None , Some ( cert_name) ) => {
387
- if cert_names. get ( cert_name. as_str ( ) ) . is_none ( ) {
387
+ if ! cert_names. contains ( cert_name. as_str ( ) ) {
388
388
miette:: bail!(
389
389
"certificate \" {}\" issuer certificate \" {}\" does not exist" ,
390
390
cert. name,
@@ -394,7 +394,7 @@ pub fn load_and_validate(path: &std::path::Path) -> Result<Document> {
394
394
}
395
395
}
396
396
397
- if kp_names. get ( cert. issuer_key . as_str ( ) ) . is_none ( ) {
397
+ if ! kp_names. contains ( cert. issuer_key . as_str ( ) ) {
398
398
miette:: bail!(
399
399
"certificate \" {}\" issuer key pair \" {}\" does not exist" ,
400
400
cert. name,
0 commit comments