From 3c817c86a645bfbd25729c037036319986eee0ec Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:17:15 -0500 Subject: [PATCH] Ci fixups: async-std tests + don't expect out dir to exist --- async-stripe/src/client/base/async_std.rs | 2 +- openapi/src/main.rs | 11 +++++++---- stripe_types/src/generated/tax_id/mod.rs | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/async-stripe/src/client/base/async_std.rs b/async-stripe/src/client/base/async_std.rs index 1c078868b..4ce2b45bb 100644 --- a/async-stripe/src/client/base/async_std.rs +++ b/async-stripe/src/client/base/async_std.rs @@ -168,7 +168,7 @@ mod tests { mock.assert_hits_async(1).await; match res { - Err(StripeError::Stripe(x)) => println!("{:?}", x), + Err(StripeError::Stripe(x, _)) => println!("{:?}", x), _ => panic!("Expected stripe error {:?}", res), } } diff --git a/openapi/src/main.rs b/openapi/src/main.rs index fafecd495..da7c9651b 100644 --- a/openapi/src/main.rs +++ b/openapi/src/main.rs @@ -1,6 +1,7 @@ use std::fmt::Debug; use std::fs; use std::fs::File; +use std::path::Path; use anyhow::{bail, Context, Result}; use clap::Parser; @@ -68,11 +69,13 @@ fn main() -> Result<()> { let args = Command::parse(); let in_path = args.spec_path; - let out_path = args.out; - fs::remove_dir_all(&out_path).context("could not remove out folder")?; - fs::create_dir_all(&out_path).context("could not create out folder")?; + let out_path = Path::new(&args.out); + if out_path.exists() { + fs::remove_dir_all(out_path).context("could not remove out folder")?; + } + fs::create_dir_all(out_path).context("could not create out folder")?; - info!("generating code for {} to {}", in_path, out_path); + info!("generating code for {} to {}", in_path, out_path.display()); let spec = if let Some(version) = args.fetch { let raw = fetch_spec(version, &in_path)?; diff --git a/stripe_types/src/generated/tax_id/mod.rs b/stripe_types/src/generated/tax_id/mod.rs index cd425ff4f..d8c29f1ba 100644 --- a/stripe_types/src/generated/tax_id/mod.rs +++ b/stripe_types/src/generated/tax_id/mod.rs @@ -289,4 +289,4 @@ impl stripe_types::Object for TaxId { Some(self.id.as_str()) } } -stripe_types::def_id!(TaxIdId, "txi_"); +stripe_types::def_id!(TaxIdId, "txi_" | "atxi_");