Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created January 24, 2020 16:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save rust-play/3c65be25f3334da7947b0e120dce23a1 to your computer and use it in GitHub Desktop.
Save rust-play/3c65be25f3334da7947b0e120dce23a1 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn mock<T: Into<String>, I: IntoIterator<Item = T>>(_: I) {}
struct Merchant<'a> {
name: &'a str,
billing_portal: &'a str,
billing_period: &'a str,
stripe_id: Option<&'a str>,
}
fn merchant() -> Merchant { unimplemented!(); }
fn run() {
let merch = merchant();
mock(&[&merch.name, &merch.billing_portal, &merch.billing_period, &merch.stripe_id])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment