From 7c19db6727faaafca762ffc8f36556b46bcb243a Mon Sep 17 00:00:00 2001 From: Mikael Muszynski Date: Sat, 25 Apr 2020 18:12:20 +0200 Subject: [PATCH] Fix erroneous code snippet in documentation (#9963) The return value in the code example is the opposite of what the code would actually return, making the example misleading. --- lib/elixir/pages/patterns-and-guards.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/pages/patterns-and-guards.md b/lib/elixir/pages/patterns-and-guards.md index 1d24b5ca23..cfbd871699 100644 --- a/lib/elixir/pages/patterns-and-guards.md +++ b/lib/elixir/pages/patterns-and-guards.md @@ -309,7 +309,7 @@ iex> case "hello" do ...> _anything_else -> ...> :failed ...> end -:worked +:failed ``` In many cases, we can take advantage of this. In the code above, we used `tuple_size/1` to both check that the given value is a tuple *and* check its size (instead of using `is_tuple(something) and tuple_size(something) == 2`).