Thanks!
-
-
Replying to @rustlang
Made it to the end of the book. Was looking forward to the web server final project, but was disappointed when I saw "Coming soon!".
2 replies 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
Guess it's time to go checkout Rocket and Tokio :)
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
Pretty straightforward to run a web server with Rocket fn main() { rocket::ignite().mount("/", routes![hello]).launch(); }
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
I'm having with this little nugget let request: &'r mut Request<'s> = unsafe { (&mut *(request as *const _ as *mut _)) };
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
What's tripping me up is request as *const _ as *mut _
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
You can chain as casts? Is the purpose of the _ for brevity so we don't have to specify types we don't care about?
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
let x:i32 = 5; let y: &mut i32 = unsafe { (&mut *(&x as *const i32 as *mut i32)) }; *y += 1; println!("{}", y);
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
Replacing i32 with u8, gives compile error error[E0606]: casting `&i32` as `*const u8` is invalid
1 reply 0 retweets 0 likes -
Replying to @jeromeleoterry @rustlang
so _ saves us from having to write the explicit type
2 replies 0 retweets 0 likes
Yup! You got it. This code looks a bit suspicious to be honest...
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.