From 2f90c4f45088fb50d02b083e84287a0b89bbd67c Mon Sep 17 00:00:00 2001
From: David Udo <65337929+davidudo@users.noreply.github.com>
Date: Mon, 23 Sep 2024 21:12:51 +0100
Subject: [PATCH] Use `:else` as last condition for `cond`
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 74b0b7f..4417193 100644
--- a/README.md
+++ b/README.md
@@ -560,10 +560,10 @@ generally preferred practice.
end
```
-*
- Use `true` as the last condition of the `cond` special form when you need a
+*
+ Use `:else` as the last condition of the `cond` special form when you need a
clause that always matches.
- [[link](#true-as-last-condition)]
+ [[link](#else-as-last-condition)]
```elixir
# not preferred
@@ -574,7 +574,7 @@ generally preferred practice.
1 + 3 == 5 ->
"Uh, uh"
- :else ->
+ true ->
"OK"
end
@@ -586,7 +586,7 @@ generally preferred practice.
1 + 3 == 5 ->
"Uh, uh"
- true ->
+ :else ->
"OK"
end
```