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

What? No: https://doc.rust-lang.org/1.61.0/src/alloc/slice.rs.html#854.... ToOwned for [T] gives you Vec<T>.


Huh. TIL

Actually now that I think harder about this, WTF did I think was really going on here before. If we clone the slice to make an array, where does the array go? We don't know how big that array is, so we can't put it on the stack.

Yeah, that was crazy. Thanks for pointing it out.




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

Search: