Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of X1 X2 Y1 Y2 type lists in derive macro #7

Open
tgross35 opened this issue Jul 26, 2023 · 0 comments
Open

Handling of X1 X2 Y1 Y2 type lists in derive macro #7

tgross35 opened this issue Jul 26, 2023 · 0 comments

Comments

@tgross35
Copy link
Contributor

I'm thinking we could do something like

Struct Foo {
    #[from_record(defines_len = coords)]
    num_points: i32,
    #[from_record(array = (b"X", b"Y"))]
    coords: Vec<(i32, i32)>
}

And then our proc macro would:

  • Use NumPoints to create a vector with defaults
  • When it sees Xn or Yn, set that value in our vector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant