Skip to content

Commit 6ade2b9

Browse files
fix: clippy warnings
1 parent e956015 commit 6ade2b9

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

gen/src/arbitrary_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Arbitrary for LowerAToZNumDash {
2323
let i = v % 37;
2424

2525
match i {
26-
0 => '-' as u8,
26+
0 => b'-',
2727
1..=10 => i + 47,
2828
_ => i + 86,
2929
}

gen/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,6 @@ pub fn gen_rnd_demo_data(size: u8) -> Vec<ProductFootprint> {
683683
loop {
684684
let mut tce = Tce::arbitrary(&mut og);
685685

686-
tce.shipment_id = ship_foot.shipment_id.clone();
687-
688686
if let Some(prev_tce) = tces.last() {
689687
// Updates prevTceIds for the current TCE
690688
prev_tces.push(prev_tce.tce_id.clone());
@@ -753,9 +751,12 @@ pub fn gen_rnd_demo_data(size: u8) -> Vec<ProductFootprint> {
753751
Some(vec![CharFactors::Ar6]),
754752
);
755753

754+
756755
tocs.push(toc.clone());
757756
}
758757

758+
tce.shipment_id.clone_from(&ship_foot.shipment_id);
759+
759760
tces.push(tce);
760761
i += 1;
761762
if i == limit {

gen/src/pact_integration.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ fn ship_foot_to_pfc() {
354354
"ShipmentFootprint with id shipment-test"
355355
);
356356
assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::TonKilometer);
357-
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(33840).into());
358-
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(3131.06).into());
357+
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(33840));
358+
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(3131.06));
359359
}
360360

361361
#[test]
@@ -401,8 +401,8 @@ fn toc_to_pcf() {
401401

402402
assert_eq!(pfc.product_name_company.0, "TOC with ID toc-test");
403403
assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::TonKilometer);
404-
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1).into());
405-
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(0.007).into());
404+
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1));
405+
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(0.007));
406406
}
407407

408408
#[test]
@@ -452,6 +452,6 @@ fn hoc_to_pfc() {
452452

453453
assert_eq!(pfc.product_name_company.0, "HOC with ID hoc-test");
454454
assert_eq!(pfc.pcf.declared_unit, DeclaredUnit::Kilogram);
455-
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1000).into());
456-
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(33).into());
455+
assert_eq!(pfc.pcf.unitary_product_amount.0, dec!(1000));
456+
assert_eq!(pfc.pcf.p_cf_excluding_biogenic.0, dec!(33));
457457
}

0 commit comments

Comments
 (0)