From 8e996ff2fe57ea7ba90c2c755255c137b211959e Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 30 Jan 2023 21:37:09 +0000 Subject: [PATCH] tpm: drop unnecessary cast Signed-off-by: Wei Liu --- tpm/src/emulator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tpm/src/emulator.rs b/tpm/src/emulator.rs index de4aaa5dd..1fee0e01c 100644 --- a/tpm/src/emulator.rs +++ b/tpm/src/emulator.rs @@ -197,12 +197,12 @@ impl Emulator { debug!("Control Cmd to send : {:02X?}", cmd); let cmd_no = (cmd as u32).to_be_bytes(); - let n: isize = (mem::size_of::() + msg_len_in) as isize; + let n = mem::size_of::() + msg_len_in; let converted_req = msg.ptm_to_request(); debug!("converted request: {:02X?}", converted_req); - let mut buf = Vec::::with_capacity(n as usize); + let mut buf = Vec::::with_capacity(n); buf.extend(cmd_no); buf.extend(converted_req);