diff options
Diffstat (limited to '')
-rw-r--r-- | src/doc/book/redirects/if.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/doc/book/redirects/if.md b/src/doc/book/redirects/if.md new file mode 100644 index 000000000..ff97e94f1 --- /dev/null +++ b/src/doc/book/redirects/if.md @@ -0,0 +1,22 @@ +% if + +<small>There is a new edition of the book and this is an old link.</small> + +> An `if` expression allows us to branch our code depending on conditions. + +```rust +fn main() { + let number = 3; + + if number < 5 { + println!("condition was true"); + } else { + println!("condition was false"); + } +} +``` + +--- + +You can find the latest version of this information +[here](ch03-05-control-flow.html#if-expressions).
\ No newline at end of file |