Surface chapter code contains compilation errors!
Jatinchhabra21 opened this issue · 2 comments
Jatinchhabra21 commented
I don't understand it fully but in new method of State implementation we are passing reference to a window but when instantiating a surface we are again passing a reference to window (which itself is a reference to window)? This causes compilation error cannot return value referencing local variable window
.
async fn new(window: &'a Window) {}
instance.create_surface(&window)
AndrewDanial commented
Hello! Not sure if this issue is still relevant to you but I got arround this by simply removing the &
from window, so the line is simply instance.create_surface(window);
. I also didn't find the unsafe
block to be necessary.
Jatinchhabra21 commented
Hi Andrew! I did resolve the issue already, it was more of an FYI. I was not sure if it was intended for future chapters, so raised an issue here to get some thoughts.