Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sounds like you have both little experience with rust and didn't read the linked page.

Dynamically sized arrays have been in the standard library since day 1.

https://doc.rust-lang.org/stable/std/vec/struct.Vec.html



i didn't mean rust didn't have dynamic sized arrays, i even mentionned Vec in my comment.

I am indeed a beginner in rust, and i was surprised by the completely different syntax & types for arrays and Vec... I read about it afterward and get the reason for it, but that's the first time i encountered that peculiarity in a language..


I think you were downvoted because your comment appeared to be making an incorrect assertion confidently, rather than asking a question.

> funny how rust doesn't seem to let you easily work with dynamically sized array

Could instead have been

> why did the author choose a hashmap?


A Rust Vec is very similar, if I recall correctly, to a C++ vector. It can basically be used like a List but is implemented underneath as an automatically dynamically-sizing array.


That's fair, many languages will only have Vecs, and will call them arrays, so it can cause confusion coming to Rust :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: