-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Using of struct in vector. #1777
Conversation
Storing structs in a vector allows you to manage a collection of structured data dynamically, and it's a flexible way to work with multiple instances of the same type.
I don't know why you're asking me to review this. I don't have Push permissions on this repo. |
I am sorry about that . Its my bad that I thought you are reviewer. |
Apologies to those who were pinged (it appears the pinging comment has been deleted). @mani-chand please email me (my username at google.com) to discuss. |
Hello @djmitche ,I am sorry for tagging wrong users. I have mailed you.Let me know about changes in PR. I thing it is good to merge. |
Hello @djmitche , Can you please let me known about status of PR. |
1 similar comment
Hello @djmitche , Can you please let me known about status of PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of cases where students were confused about what sort of values can be put into a Vec. Most students come to this course from C/C++, Java, Go, or an interpreted language like Python or Ruby -- all of which allow any type of value to be placed in an array/list/vector. Maybe @randomPoison or @marshallpierce can provide their perspective?
This slide is already in our "preferred" format, which is to say it's small enough to fit on a single screen (more info in #1464). So, adding another 10 lines to the content is a bit counter-productive. If we do decide to include this content, i think it needs to be done in a way that does not add more lines to the example or remove any of the existing lessons.
Ok , I will check. |
Hello djmitche , Is it ok to add 5 lines in speakers notes. If it is not possible then you can suggest is any other way or, I am happy close my PR because there is no other way. |
I haven't seen any student confusion over this. Since Rust does not have limitations on what the generic type can be (ala Java's generics only applying to reference types, not primitives), I suspect it might cause more confusion than clarity to single out structs for special treatment. Why not enums, or references? |
Hello marshallpierce, Thanks for the clarification . I am happy to close my PR then. |
Storing structs in a vector allows you to manage a collection of structured data dynamically, and it's a flexible way to work with multiple instances of the same type.
For Example :
Every website as users and user has data like email, name, password . for storing user data we need struct (In which we can store different type of data) and vector is used to store multiple values of same type of data.
By using both vector and struct we can any number of user's data in a structured way.