Skip to content

Commit

Permalink
Remove Box in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Jan 31, 2022
1 parent 6ba9415 commit 276e704
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions tests/charge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ fn is_charge_retrievable() {
};
assert_eq!(charge.id, "ch_123");
if let Some(cus) = charge.customer {
assert!(!(*cus).is_object());
assert!(!cus.is_object());
}
if let Some(inv) = charge.invoice {
assert!(!(*inv).is_object());
assert!(!inv.is_object());
}
});
}
Expand Down Expand Up @@ -47,10 +47,10 @@ fn is_charge_expandable() {
};
assert_eq!(charge.id, "ch_123");
if let Some(cus) = charge.customer {
assert!((*cus).is_object());
assert!(cus.is_object());
}
if let Some(inv) = charge.invoice {
assert!((*inv).is_object());
assert!(inv.is_object());
}
});
}
10 changes: 5 additions & 5 deletions tests/plan_interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn can_create_plan() {
let id = "price_123".parse().unwrap();
mock::with_client(|client| {
let mut plan = stripe::Plan::retrieve(client, &id, &[]).unwrap();
plan.interval = Some(Box::new(stripe::PlanInterval::Month));
plan.interval = Some(stripe::PlanInterval::Month);
});
}

Expand All @@ -18,7 +18,7 @@ fn can_create_plan() {
fn can_create_subscription_interval() {
let _recurring = stripe::SubscriptionPriceDataRecurring {
interval: stripe::SubscriptionInterval::Month,
interval_count: Some(Box::new(100)),
interval_count: Some(100),
};
}

Expand All @@ -28,17 +28,17 @@ fn can_create_subscription_plan_interval() {
mock::with_client(|client| {
let id = "sub_123".parse().unwrap();
let mut create = stripe::CreateSubscriptionItem::new(id);
create.price_data = Some(Box::new(stripe::SubscriptionItemPriceData {
create.price_data = Some(stripe::SubscriptionItemPriceData {
currency: stripe::Currency::USD,
product: "My Product".to_string(),
recurring: stripe::SubscriptionItemPriceDataRecurring {
interval: stripe::SubscriptionItemInterval::Day,
interval_count: Some(Box::new(6)),
interval_count: Some(6),
},
tax_behavior: None,
unit_amount: None,
unit_amount_decimal: None,
}));
});
let _result = stripe::SubscriptionItem::create(client, create).unwrap();
});
}

0 comments on commit 276e704

Please sign in to comment.