From 5247fcfff678e1fd076629805142b190cc264f3a Mon Sep 17 00:00:00 2001 From: Vyacheslav Bikbaev Date: Thu, 3 May 2018 22:56:48 +0300 Subject: [PATCH] chore: removed trailing whitespaces, added newline at the end of the file Signed-off-by: Vyacheslav Bikbaev --- README.md | 2 +- lib/koans/11_sigils.ex | 1 - lib/koans/18_genservers.ex | 16 ++++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 83b95e32..608b147f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ mix meditate --no-clear-screen If you want to jump to a specific lesson, run it with `--koan=` ```sh -$ mix meditate --koan=PatternMatching +$ mix meditate --koan=PatternMatching ``` Any typos on the koan name will show the complete list of koans, where you can pick any. diff --git a/lib/koans/11_sigils.ex b/lib/koans/11_sigils.ex index deef195d..4f28cee6 100644 --- a/lib/koans/11_sigils.ex +++ b/lib/koans/11_sigils.ex @@ -36,4 +36,3 @@ defmodule Sigils do assert ~W(Hello #{1+1}) == ___ end end - diff --git a/lib/koans/18_genservers.ex b/lib/koans/18_genservers.ex index 8ad45897..0738e104 100644 --- a/lib/koans/18_genservers.ex +++ b/lib/koans/18_genservers.ex @@ -44,9 +44,9 @@ defmodule GenServers do #### # GenServer implementation - + def handle_call(:get_password, _from, current_password) do - {:reply, current_password, current_password} + {:reply, current_password, current_password} end def handle_call(:get_manufacturer, _from, current_state) do @@ -68,22 +68,22 @@ defmodule GenServers do def handle_call(:name_check, _from, current_state) do {:reply, "Congrats! Your process was successfully named.", current_state} end - + def handle_call({:unlock, password}, _from, current_password) do case password do password when password === current_password -> {:reply, {:ok, "Laptop unlocked!"}, current_password} - _ -> + _ -> {:reply, {:error, "Incorrect password!"}, current_password} end end - + def handle_cast({:change_password, old_password, new_password}, current_password) do case old_password do old_password when old_password == current_password -> {:noreply, new_password} _ -> - {:noreply, current_password} + {:noreply, current_password} end end end @@ -147,7 +147,7 @@ defmodule GenServers do {_, response} = Laptop.unlock("EL!73") assert response == ___ - {_, response} = Laptop.owner_name + {_, response} = Laptop.owner_name assert response == ___ end -end \ No newline at end of file +end