{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreicm5vjilocwwx4pzvmg33qsx73s6as4fkg2vqmhm4t32bvbsukuam",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3min7x5due572"
},
"path": "/t/change-error-message-of-a-failing-assert-eq/24118?page=2#post_23",
"publishedAt": "2026-04-03T23:35:43.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "One option is to wrap the assert_eq! in a custom function, so that `let user_id = 10; let actual = \"Alice B.\"; let expected = \"Alice Baker\";\n\n\n assert_eq!(\n actual, expected,\n \"User: {} has mismatched name. Expected {}, got {}\",\n user_id, expected, actual\n );`\n",
"title": "Change error message of a failing `assert_eq!`"
}