too-many-lists
too-many-lists copied to clipboard
Probably small typo
In the chaper 6.7 Layout + Basic Redux
Hey that code's actuallyy looking a lot cleaner now that we're sticking to raw pointers!
On to pop, which is also pretty similar to how we left it, although we've got to remember to use Box::from_raw to clean up the allocation:
y/n with actuallyy
And in the chaper 6.8 before Moment of truth time...
There should be as_ref/as_mut
or as_deref/as_deref_mut
functions?
I just ran into your second comment. It doesn't compile with as_deref / as_deref_mut. I'm trying adding and unsafe block and using as_ref and as_mut.
I'm not 100% sure what y'all mean, but I assume you're just thrown off because the head is a raw pointer and doesn't have an Option anymore?
(the other typo has been fixed, thanks!)
I've also stumbled here. The code in 6.8, attempting to call the as_deref()
and as_deref_mut()
methods on the head raw pointer won't compile. The full listing in 6.9 will, as it uses the as_ref()
and as_mut()
methods, wrapped in an unsafe
block. This is how it seems to me at least - forgive any oversights.
Yes, I also figured out the as_deref/as_deref_mut
part isn't correct when reimplemting the whole thing step-by-step. It is also funny because the next sentence is YES!!! Take that NARRATOR! Sometimes I don't make mistakes!
.