mcc on Nostr: *rubbing eyes* Anyone use "Rocket"? The worst/most Ruby-like thing about Rocket is ...
*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
Published at
2026-02-08 21:10:09 UTCEvent JSON
{
"id": "a64f8713a1e666704e9ac2ac892f33f81fb3126936a7ca3bc3d47d29781852ba",
"pubkey": "582a41c6eca3d12c80acd248a7c8f3070c83c859b9ac1739cbecc074cf09a747",
"created_at": 1770585009,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/@mcc/116037059162356007",
"web"
],
[
"imeta",
"url https://files.mastodon.social/media_attachments/files/116/037/053/618/528/032/original/a8303735151d86c8.png",
"m image/png"
],
[
"proxy",
"https://mastodon.social/users/mcc/statuses/116037059162356007",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://mastodon.social/users/mcc/statuses/116037059162356007",
"pink.momostr"
],
[
"-"
]
],
"content": "*rubbing eyes* Anyone use \"Rocket\"?\n\nThe 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.\n\nUnless it doesn't, and you have *no* idea what to return.\n\nFor a string, you return a String.\n\nWhat do I return for bytes? It's not a string, it's a \u0026[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\nhttps://files.mastodon.social/media_attachments/files/116/037/053/618/528/032/original/a8303735151d86c8.png\n",
"sig": "c231ef6ec9d96f8b462fc47554973beafb72a9ed016b7078543bc4546a6f795f8bc0da9549a0112905f360ca2b646714740867b304fd0911e5a3ceeec4b5ba9c"
}