diff --git a/examples/checkout.rs b/examples/checkout.rs index da7ba1c9b..e95bba957 100644 --- a/examples/checkout.rs +++ b/examples/checkout.rs @@ -28,9 +28,10 @@ async fn main() { description: Some( "A fake customer that is used to illustrate the examples in async-stripe.", ), - metadata: Some( - [("async-stripe".to_string(), "true".to_string())].iter().cloned().collect(), - ), + metadata: Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), ..Default::default() }, @@ -43,8 +44,10 @@ async fn main() { // create a new exmaple project let product = { let mut create_product = CreateProduct::new("T-Shirt"); - create_product.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_product.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); Product::create(&client, create_product).await.unwrap() }; @@ -52,8 +55,10 @@ async fn main() { let price = { let mut create_price = CreatePrice::new(Currency::USD); create_price.product = Some(IdOrCreate::Id(&product.id)); - create_price.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_price.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); create_price.unit_amount = Some(1000); create_price.expand = &["product"]; Price::create(&client, create_price).await.unwrap() diff --git a/examples/customer.rs b/examples/customer.rs index 67711f633..b831ac517 100644 --- a/examples/customer.rs +++ b/examples/customer.rs @@ -22,9 +22,10 @@ async fn main() { description: Some( "A fake customer that is used to illustrate the examples in async-stripe.", ), - metadata: Some( - [("async-stripe".to_string(), "true".to_string())].iter().cloned().collect(), - ), + metadata: Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), ..Default::default() }, @@ -42,9 +43,10 @@ async fn main() { description: Some( "A fake customer that is used to illustrate the examples in async-stripe.", ), - metadata: Some( - [("async-stripe".to_string(), "true".to_string())].iter().cloned().collect(), - ), + metadata: Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), ..Default::default() }, diff --git a/examples/payment-intent.rs b/examples/payment-intent.rs index a3b067dea..3384e411c 100644 --- a/examples/payment-intent.rs +++ b/examples/payment-intent.rs @@ -26,9 +26,10 @@ async fn main() { description: Some( "A fake customer that is used to illustrate the examples in async-stripe.", ), - metadata: Some( - [("async-stripe".to_string(), "true".to_string())].iter().cloned().collect(), - ), + metadata: Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), ..Default::default() }, diff --git a/examples/payment-link.rs b/examples/payment-link.rs index 4f9d70dc0..bd2a353f0 100644 --- a/examples/payment-link.rs +++ b/examples/payment-link.rs @@ -20,8 +20,10 @@ async fn main() { // create a new example project let product = { let mut create_product = CreateProduct::new("T-Shirt"); - create_product.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_product.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); Product::create(&client, create_product).await.unwrap() }; @@ -29,8 +31,10 @@ async fn main() { let price = { let mut create_price = CreatePrice::new(Currency::USD); create_price.product = Some(IdOrCreate::Id(&product.id)); - create_price.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_price.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); create_price.unit_amount = Some(1000); create_price.expand = &["product"]; Price::create(&client, create_price).await.unwrap() diff --git a/examples/subscriptions.rs b/examples/subscriptions.rs index 10c5bac4b..391fc08b1 100644 --- a/examples/subscriptions.rs +++ b/examples/subscriptions.rs @@ -26,9 +26,10 @@ async fn main() { description: Some( "A fake customer that is used to illustrate the examples in async-stripe.", ), - metadata: Some( - [("async-stripe".to_string(), "true".to_string())].iter().cloned().collect(), - ), + metadata: Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), ..Default::default() }, @@ -76,8 +77,10 @@ async fn main() { // create a new exmaple project let product = { let mut create_product = CreateProduct::new("Monthly T-Shirt Subscription"); - create_product.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_product.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); Product::create(&client, create_product).await.unwrap() }; @@ -85,8 +88,10 @@ async fn main() { let price = { let mut create_price = CreatePrice::new(Currency::USD); create_price.product = Some(IdOrCreate::Id(&product.id)); - create_price.metadata = - Some([("async-stripe".to_string(), "true".to_string())].iter().cloned().collect()); + create_price.metadata = Some(std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])); create_price.unit_amount = Some(1000); create_price.recurring = Some(CreatePriceRecurring { interval: CreatePriceRecurringInterval::Month,