Andy Price on Nostr: .unwrap() should require unsafe{} ...
.unwrap() should require unsafe{}
Buried in this nicely-detailed RCA is a pretty damning fact:
Cloudflare left .unwrap() in mission-critical Rust code.
For non-Rustaceans, .unwrap() handles a type called Result that can either be Ok with a value, or an Err with an Error. The whole point is to gracefully handle errors and not let panics make it to production code.
I use .unwrap() sometimes! Usually when there's a logical guarantee that the result can never be an error. But I make sure to purge it from critical processes for exactly this reason.
https://blog.cloudflare.com/18-november-2025-outage/
Published at
2025-11-19 01:20:14 UTCEvent JSON
{
"id": "efa4685a49748db522ecb537b11c526f4fdb24bf5a78135561d304c2992a937f",
"pubkey": "2c06fd8d9a4aaf700e9726e0ca4d1553a317748a59b40d86ebbb8e32e776c742",
"created_at": 1763515214,
"kind": 1,
"tags": [
[
"q",
"b535891a94b244b19f49d2d053d6db04444ce9110d94cb8981491df815d77b9e",
"wss://relay.ditto.pub/"
],
[
"proxy",
"https://mastodon.social/users/andyprice/statuses/115573733103542209",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub/"
]
],
"content": "\n\n.unwrap() should require unsafe{}\n\nnostr:nevent1qyt8wumn8ghj7un9d3shjtnyd968gmewwp6kytcqyz6ntzg6jjeyfvvlf8fdq57kmvzygn8fzyxefjufs9y3m7q46aaeuv7pdt0",
"sig": "4c37842bec678f348a14e14b006fbea9e7e1bdd92705f6f5d18df6d3c7c30e9d25d0f46f002f1502853d32dd920a17ce2c37ec4c5c62d16791c0313875df758a"
}