When reaching Box lesson I got epiphany that String is just Box::new("foo"). While not being exactly correct (String object is more feature rich than slice) it helped me to understand why compiler is not complaining about struct size when I define "Struct{ x: String }". Somehow suddenly this heap/stack concept "clicked" in my mind.
When reaching Box lesson I got epiphany that String is just Box::new("foo"). While not being exactly correct (String object is more feature rich than slice) it helped me to understand why compiler is not complaining about struct size when I define "Struct{ x: String }". Somehow suddenly this heap/stack concept "clicked" in my mind.
is it possible to use `.into()` instead of the new constructor? Feels like that would make it look more intuitive.
ah yes putting things into boxes
isn't it Deref(erence)
Yes. I meant to say Deref and not Defer
I have checked. the Box did not implement Defer, it's trait Deref that you mean.
Thank you for the correction!
@@TheDevMethod Will it still be memory safe?
oh boi i cant wait to see what this new trait "Defer" does
deref_move want
I mean to say Deref and not Defer.