Skip to content

Commit

Permalink
wilburforce's feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ana Hobden <operator@hoverbear.org>
  • Loading branch information
Hoverbear committed Jun 24, 2022
1 parent 087f90f commit 668496e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content/blog/2014-08-12-option-monads-in-rust/index.md
Expand Up @@ -137,13 +137,13 @@ Let's see what the same code would look like using the `Option` monad. In this e
fn main () {
let number: f64 = 20.;
// Perform a pipeline of options.
let result = Some(number)
.map(inverse) // Described below.
Some(number)
.map(double)
.map(inverse)
.map(inverse) // Described below.
.and_then(log) // Described below.
.map(square)
.and_then(sqrt);
.map(inverse)
.and_then(sqrt);
// Extract the result.
match result {
Some(x) => println!("Result was {}.", x),
Expand Down

0 comments on commit 668496e

Please sign in to comment.