jex on Nostr: or how bout we chain method calls? fn read_bitcoin_file() -> Result<f64, io::Error> { ...
or how bout we chain method calls?
fn read_bitcoin_file() -> Result<f64, io::Error> {
let mut bitcoin_amount = String::new();
File::open("bitcoin_amount_file.txt")?.read_to_string(&mut bitcoin_amount)?;
Ok(bitcoin_amount.trim().parse::<f64>().unwrap())
}
Published at
2024-01-23 01:35:18Event JSON
{
"id": "4b8b188f3158e5b2e0150fb27ad15ea123d716b9c21dbc7b1a56f8c9df330274",
"pubkey": "1f0b7103e799e60b76d849bf2696d25820472619d5b0453bc781cb3f78008477",
"created_at": 1705973718,
"kind": 1,
"tags": [
[
"e",
"d5bba16b08c90f6c46d9b98cd745994eab4ad96c28c52e93d453733c150152aa",
"",
"reply"
],
[
"p",
"1f0b7103e799e60b76d849bf2696d25820472619d5b0453bc781cb3f78008477"
]
],
"content": "or how bout we chain method calls?\n\nfn read_bitcoin_file() -\u003e Result\u003cf64, io::Error\u003e {\n let mut bitcoin_amount = String::new();\n File::open(\"bitcoin_amount_file.txt\")?.read_to_string(\u0026mut bitcoin_amount)?;\n Ok(bitcoin_amount.trim().parse::\u003cf64\u003e().unwrap())\n}",
"sig": "37d8626f7b93bac4db97b3c276862089f0e33353880d54420c66182bede2ae1508fcf000abb22367616b6a50c122ce6b40de058049a843726d56340c599ef887"
}