[dice] Remove redundant try_from() in dice::sample_inputs
Bug: 267575445
Test: atest diced_utils_test diced_sample_inputs_test \
diced_test diced_vendor_test
Change-Id: I6f4da5ff7579adb5e77c27b1a7d08f945141100b
diff --git a/diced/src/sample_inputs.rs b/diced/src/sample_inputs.rs
index ff239ed..bab296a 100644
--- a/diced/src/sample_inputs.rs
+++ b/diced/src/sample_inputs.rs
@@ -24,7 +24,7 @@
use diced_utils::cbor;
use diced_utils::InputValues;
use keystore2_crypto::ZVec;
-use std::convert::{TryFrom, TryInto};
+use std::convert::TryInto;
use std::io::Write;
/// Sample UDS used to perform the root dice flow by `make_sample_bcc_and_cdis`.
@@ -82,12 +82,7 @@
let input_values_vector = get_input_values_vector();
let (cdi_attest, cdi_seal, mut cert) = dice_ctx
- .main_flow(
- UDS,
- UDS,
- &InputValues::try_from(&input_values_vector[0])
- .context("In make_sample_bcc_and_cdis: Trying to convert input values. (0)")?,
- )
+ .main_flow(UDS, UDS, &InputValues::from(&input_values_vector[0]))
.context("In make_sample_bcc_and_cdis: Trying to run first main flow.")?;
let mut bcc: Vec<u8> = vec![];
@@ -108,8 +103,7 @@
"In make_sample_bcc_and_cdis: Failed to convert cdi_seal to array reference. (1)",
)?,
&bcc,
- &InputValues::try_from(&input_values_vector[1])
- .context("In make_sample_bcc_and_cdis: Trying to convert input values. (1)")?,
+ &InputValues::from(&input_values_vector[1]),
)
.context("In make_sample_bcc_and_cdis: Trying to run first bcc main flow.")?;
dice_ctx
@@ -121,8 +115,7 @@
"In make_sample_bcc_and_cdis: Failed to convert cdi_seal to array reference. (2)",
)?,
&bcc,
- &InputValues::try_from(&input_values_vector[2])
- .context("In make_sample_bcc_and_cdis: Trying to convert input values. (2)")?,
+ &InputValues::from(&input_values_vector[2]),
)
.context("In make_sample_bcc_and_cdis: Trying to run second bcc main flow.")
}