Shane Celis on Nostr: Another case I like to use `Cow` is for catch all error messages. Because if you ...
Another case I like to use `Cow` is for catch all error messages. Because if you don't have to format the string, the string is already in memory; just use it. But when you do need to add more information, you can.
This is not to say that catch all errors are good. They aren't. Use `thiserror` and don't reify strings at all. #rustlang
Published at
2026-10-23 20:49:19 UTCEvent JSON
{
"id": "75e3c362e5583238a32e859f610d62794296f27e438b7a69c1786098c20ff1eb",
"pubkey": "f93e59dd814c9044fb46ce81b53227818c9589e4797d801f439f84dac9619b7b",
"created_at": 1792788559,
"kind": 1,
"tags": [
[
"t",
"rustlang"
],
[
"imeta",
"url https://cdn.masto.host/mastodongamedevplace/media_attachments/files/117/492/190/820/639/980/original/ef84825b9820278d.png",
"m image/png",
"dim 996x436",
"blurhash U04n}j~qD$9FWFt8xvjc00IV%O-=?cxbR$oe"
],
[
"proxy",
"https://mastodon.gamedev.place/users/shanecelis/statuses/117492191066160356",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Another case I like to use `Cow` is for catch all error messages. Because if you don't have to format the string, the string is already in memory; just use it. But when you do need to add more information, you can.\n\nThis is not to say that catch all errors are good. They aren't. Use `thiserror` and don't reify strings at all. #rustlang\n\nhttps://cdn.masto.host/mastodongamedevplace/media_attachments/files/117/492/190/820/639/980/original/ef84825b9820278d.png",
"sig": "9abda82d3b6b1e2fb0b539cdedaab67499e7c3b849b21a9291ba05934eabefdbedb0f144cdffaeffa1160d429e7bb8368d40c29dbecf617148810834ca68be56"
}