diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index 24f312fe7d..f6bc31624b 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -81,7 +81,7 @@ async fn _prepare_temporary_credential(validators: &[Url], raw_identity: &[u8]) serial_number: params.random_scalar(), binding_number: params.random_scalar(), voucher_value: hash_to_scalar(BANDWIDTH_VALUE.to_be_bytes()), - voucher_info: hash_to_scalar(String::from("BandwidthVoucher").as_bytes()), + voucher_info: hash_to_scalar("BandwidthVoucher"), }; let bandwidth_credential = credentials::bandwidth::obtain_signature( diff --git a/common/credentials/src/bandwidth.rs b/common/credentials/src/bandwidth.rs index bce2cda06e..cbb80439e2 100644 --- a/common/credentials/src/bandwidth.rs +++ b/common/credentials/src/bandwidth.rs @@ -38,10 +38,7 @@ pub struct BandwidthVoucherAttributes { impl BandwidthVoucherAttributes { pub fn get_public_attributes(&self) -> Vec { - let mut pub_attributes = Vec::with_capacity(PUBLIC_ATTRIBUTES as usize); - pub_attributes.push(self.voucher_value); - pub_attributes.push(self.voucher_info); - pub_attributes + vec![self.voucher_value, self.voucher_info] } pub fn get_private_attributes(&self) -> Vec {