Joel Michael on Nostr: let mutex = None; let file = None; loop { […] if let None = file { file = None; // ...
let mutex = None;
let file = None;
loop {
[…]
if let None = file {
file = None; // DO NOT REMOVE - makes borrow checker happy
mutex = None;
mutex = Some(card.lock().unwrap());
file = Some(mutex.open_file(FILE));
}
[…]
}
Completely normal programming language…
#Rust #RustLang
Published at
2023-12-11 23:25:20Event JSON
{
"id": "b71e93c70fea429490e40f4a61100c44cad3dc6bb8c529af3a3079ce32a540c2",
"pubkey": "980dc0341fa310a3e74aadf950fb6d89c89afa10609dd687ab7d3f0574f6ed87",
"created_at": 1702337120,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"t",
"rustlang"
],
[
"proxy",
"https://aus.social/users/jpm/statuses/111564365508232505",
"activitypub"
]
],
"content": "let mutex = None;\nlet file = None;\n\nloop {\n[…]\n if let None = file {\n file = None; // DO NOT REMOVE - makes borrow checker happy\n mutex = None;\n mutex = Some(card.lock().unwrap());\n file = Some(mutex.open_file(FILE));\n }\n[…]\n}\n\nCompletely normal programming language…\n\n#Rust #RustLang",
"sig": "6292d954ac5c3b74543278f85f2b15a4c58ec75b129fe4a58e0bc2b343335d035f80b9bb0330409257852ab785f792030f57515780e775fce0df5831ff90a790"
}