88use std:: path:: { Path , PathBuf } ;
99
1010use clap:: clap_app;
11- use pcs:: { PckID , DcapArtifactIssuer , WriteOption } ;
11+ use pcs:: { PckID , DcapArtifactIssuer , WriteOptionsBuilder } ;
1212use reqwest:: Url ;
1313use rustc_serialize:: hex:: ToHex ;
1414use serde:: de:: { value, IntoDeserializer } ;
@@ -72,7 +72,7 @@ fn download_dcap_artifacts(
7272 // instead we mimic it using pckcert API.
7373 let pckcerts = prov_client. pckcerts_with_fallback ( & pckid) ?;
7474
75- let pckcerts_file = pckcerts. store ( output_dir, pckid. qe_id . as_slice ( ) , WriteOption { overwrite : true } ) ?;
75+ let pckcerts_file = pckcerts. store ( output_dir, pckid. qe_id . as_slice ( ) , WriteOptionsBuilder :: new ( ) . build ( ) ) ?;
7676
7777 if verbose {
7878 println ! ( " pckcerts: {}" , pckcerts_file. unwrap( ) . display( ) ) ;
@@ -82,7 +82,7 @@ fn download_dcap_artifacts(
8282 let evaluation_data_numbers = prov_client
8383 . tcb_evaluation_data_numbers ( ) ?;
8484
85- let file = evaluation_data_numbers. write_to_file ( output_dir, WriteOption { overwrite : true } ) ?;
85+ let file = evaluation_data_numbers. write_to_file ( output_dir, WriteOptionsBuilder :: new ( ) . build ( ) ) ?;
8686 if verbose {
8787 println ! ( " tcb evaluation data numbers: {}\n " , file. unwrap( ) . display( ) ) ;
8888 }
@@ -93,7 +93,7 @@ fn download_dcap_artifacts(
9393
9494 match tcb_info {
9595 Ok ( tcb_info) => {
96- let file = tcb_info. store ( output_dir, WriteOption { overwrite : true } ) ?;
96+ let file = tcb_info. store ( output_dir, WriteOptionsBuilder :: new ( ) . build ( ) ) ?;
9797 if verbose {
9898 println ! ( " tcb info: {}" , file. unwrap( ) . display( ) ) ;
9999 }
@@ -114,7 +114,7 @@ fn download_dcap_artifacts(
114114
115115 match qe_identity {
116116 Ok ( qe_identity) => {
117- let file = qe_identity. write_to_file ( output_dir, WriteOption { overwrite : true } ) ?;
117+ let file = qe_identity. write_to_file ( output_dir, WriteOptionsBuilder :: new ( ) . build ( ) ) ?;
118118 if verbose {
119119 println ! ( " qe identity: {}\n " , file. unwrap( ) . display( ) ) ;
120120 }
@@ -132,15 +132,15 @@ fn download_dcap_artifacts(
132132 }
133133 let pckcrl = prov_client
134134 . pckcrl ( DcapArtifactIssuer :: PCKProcessorCA )
135- . and_then ( |crl| crl. write_to_file_as ( output_dir, DcapArtifactIssuer :: PCKProcessorCA , WriteOption { overwrite : true } ) . map_err ( |e| e. into ( ) ) ) ?;
135+ . and_then ( |crl| crl. write_to_file_as ( output_dir, DcapArtifactIssuer :: PCKProcessorCA , WriteOptionsBuilder :: new ( ) . build ( ) ) . map_err ( |e| e. into ( ) ) ) ?;
136136 if verbose {
137137 println ! ( "==[ generic ]==" ) ;
138138 println ! ( " PCKProcessorCA Crl: {}" , pckcrl. unwrap( ) . display( ) ) ;
139139 }
140140
141141 let pckcrl = prov_client
142142 . pckcrl ( DcapArtifactIssuer :: PCKPlatformCA )
143- . and_then ( |crl| crl. write_to_file_as ( output_dir, DcapArtifactIssuer :: PCKPlatformCA , WriteOption { overwrite : true } ) . map_err ( |e| e. into ( ) ) ) ?;
143+ . and_then ( |crl| crl. write_to_file_as ( output_dir, DcapArtifactIssuer :: PCKPlatformCA , WriteOptionsBuilder :: new ( ) . build ( ) ) . map_err ( |e| e. into ( ) ) ) ?;
144144 if verbose {
145145 println ! ( " PCKPlatformCA Crl: {}" , pckcrl. unwrap( ) . display( ) ) ;
146146 }
0 commit comments