Skip to content

Commit e1b0c0e

Browse files
committed
Remove unnecessary vec optimisation
1 parent 59f4e96 commit e1b0c0e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

plutus-ledger-api/src/v1/interval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ where
416416
{
417417
fn to_plutus_data(&self) -> PlutusData {
418418
match self {
419-
Extended::NegInf => PlutusData::Constr(BigInt::from(0), Vec::with_capacity(0)),
419+
Extended::NegInf => PlutusData::Constr(BigInt::from(0), Vec::new()),
420420
Extended::Finite(value) => {
421421
PlutusData::Constr(BigInt::from(1), vec![value.to_plutus_data()])
422422
}
423-
Extended::PosInf => PlutusData::Constr(BigInt::from(2), Vec::with_capacity(0)),
423+
Extended::PosInf => PlutusData::Constr(BigInt::from(2), Vec::new()),
424424
}
425425
}
426426

plutus-ledger-api/src/v1/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl IsPlutusData for CurrencySymbol {
112112
fn to_plutus_data(&self) -> PlutusData {
113113
match self {
114114
CurrencySymbol::NativeToken(policy_hash) => policy_hash.to_plutus_data(),
115-
CurrencySymbol::Ada => PlutusData::Bytes(Vec::with_capacity(0)),
115+
CurrencySymbol::Ada => PlutusData::Bytes(Vec::new()),
116116
}
117117
}
118118

@@ -726,7 +726,7 @@ pub struct TokenName(pub LedgerBytes);
726726
impl TokenName {
727727
/// Ada tokenname (empty bytestring)
728728
pub fn ada() -> TokenName {
729-
TokenName(LedgerBytes(Vec::with_capacity(0)))
729+
TokenName(LedgerBytes(Vec::new()))
730730
}
731731

732732
pub fn is_empty(&self) -> bool {

plutus-ledger-api/src/v2/datum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub enum OutputDatum {
4040
impl Json for OutputDatum {
4141
fn to_json(&self) -> serde_json::Value {
4242
match self {
43-
OutputDatum::None => json::json_constructor("NoOutputDatum", Vec::with_capacity(0)),
43+
OutputDatum::None => json::json_constructor("NoOutputDatum", Vec::new()),
4444
OutputDatum::DatumHash(dat_hash) => {
4545
json::json_constructor("OutputDatumHash", vec![dat_hash.to_json()])
4646
}

0 commit comments

Comments
 (0)