I saw somewhere it isn't possible to implement Linked (I assume single) List in @rustlang without using `unsafe`. Is this true because I see nothing forcing me to use `unsafe`?
-
-
Yeah, even single linked lists require that “unsafe stuff”. Try to implement push_front(&mut self, value: T) with Box only. You’re going to have a hard time unless you use forget / ptr::read or MaybeUninit.
-
Hm, actually, I just dit it. :D Not very elegant, but still works without unsafety (though I consider unwrap / useless branch statement as bad practice).
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.