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

Question: what is the idiomatic solution to structs1? #240

Closed
hexpunk opened this issue Nov 15, 2019 · 1 comment
Closed

Question: what is the idiomatic solution to structs1? #240

hexpunk opened this issue Nov 15, 2019 · 1 comment

Comments

@hexpunk
Copy link

hexpunk commented Nov 15, 2019

I'm doing the exercises and I reached structs1.

Here's how I approached it: link (I put it in a gist to avoid spoilers.) In my solution I had to use lifetimes which hadn't been used up to this point in the exercises. I get the feeling there's another, more idiomatic approach that was intended by the author of the exercise.

Is there a preferred place to discuss solutions to rustlings? Or someplace that shows the most idiomatic solutions?

@hexpunk
Copy link
Author

hexpunk commented Nov 15, 2019

Ah, structs2 answered my question. I was just a bit too quick on the draw with this issue. But this does feel much like #204.

@hexpunk hexpunk closed this as completed Nov 15, 2019
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