*rubbing eyes* Anyone use "Rocket"?

The worst/most Ruby-like thing about Rocket is when you return a value from a Route function, you just kinda return… whatever datatype you want, and Rocket figures it out.

Unless it doesn't, and you have *no* idea what to return.

For a string, you return a String.

What do I return for bytes? It's not a string, it's a &[u8; 1335895] and it's not valid UTF-8. Do I return a rocket::response::ByteStream? That seems to be the correct answer but doesn't work

In the docs, ByteStream has a generic argument. However the generic argument's meaning is not documented (it's just "S"). The documentation appears to suggest, rather than filling in this S, using a macro. The macro is not doing what I expect. https://api.rocket.rs/v0.5/rocket/response/stream/struct.ByteStream

I can't tell if Rocket has a specific place to go ask for support requests, unless it's the general Rust programming discord, or here.

ByteStream in rocket::response::stream - Rust

A potentially infinite stream of bytes: any `T: AsRef<[u8]>`.

Update: .to_slice() was the magic solution. I need to remember to put this in my "things to try at random when Rust isn't working" along with typing <'_>.
<'_> in Rust is the "Wink" operator. The compiler's like "You can't do that" and you're like "*Wink* Yeah, but you'll let it slide this time, right?"
@mcc As someone who has never tried Rust, I honestly can't tell if you're joking or not.

@ryan This is literally a real thing in Rust but it's not called the wink operator. It does involve typing the characters <'_>.

Literally what it means: In Rust, every variable has a "lifetime" associated with it. Sometimes, you must explicitly tell the compiler what the lifetime is. But often, in this case, you can type <'_> which means "compiler, please figure out the lifetime for me". And often it succeeds.

@mcc @ryan thanks to this post maybe it _is_ called the wink operator though?
@smn @ryan what have i done
@mcc @smn @ryan I gotta say that “wink operator“ is much snappier than “elided lifetime“
@jyn @mcc @smn @ryan and this is why programming languages are such a mystery coming in with no prior knowledge. They are an organically grown mixture between very technical lingo and absolute in-jokes that somehow became a real thing and now cannot be changed any more. And there is no way to identify one over the other before diving into some kind of rabbit hole.
It's equally beautiful and frustrating. 😂
@mcc @smn @ryan in kotlin the symbol ?: is called the Elvis operator in official documentation.