too-many-lists icon indicating copy to clipboard operation
too-many-lists copied to clipboard

Probably small typo

Open pudnax opened this issue 2 years ago • 6 comments

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

pudnax avatar Jan 29 '22 18:01 pudnax

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?

pudnax avatar Jan 29 '22 19:01 pudnax

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.

alebahn avatar Jan 31 '22 23:01 alebahn

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?

Gankra avatar Feb 10 '22 14:02 Gankra

(the other typo has been fixed, thanks!)

Gankra avatar Feb 10 '22 14:02 Gankra

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.

kentuckyfriedmeerkat avatar Mar 21 '22 22:03 kentuckyfriedmeerkat

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!.

LeonWiese avatar Mar 29 '22 14:03 LeonWiese