diff --git a/lib/memex/accounts.ex b/lib/memex/accounts.ex index f35bbc3..13fde54 100644 --- a/lib/memex/accounts.ex +++ b/lib/memex/accounts.ex @@ -219,7 +219,7 @@ defmodule Memex.Accounts do with {:ok, query} <- UserToken.verify_change_email_token_query(token, context), %UserToken{sent_to: email} <- Repo.one(query), - {:ok, _} <- Repo.transaction(user_email_multi(user, email, context)) do + {:ok, _result} <- Repo.transaction(user_email_multi(user, email, context)) do :ok else _error_tuple -> :error diff --git a/lib/memex/accounts/user.ex b/lib/memex/accounts/user.ex index d96dadc..8af327a 100644 --- a/lib/memex/accounts/user.ex +++ b/lib/memex/accounts/user.ex @@ -140,7 +140,7 @@ defmodule Memex.Accounts.User do |> cast(attrs, [:email]) |> validate_email() |> case do - %{changes: %{email: _}} = changeset -> changeset + %{changes: %{email: _email}} = changeset -> changeset %{} = changeset -> add_error(changeset, :email, dgettext("errors", "did not change")) end end diff --git a/lib/memex/accounts/user_token.ex b/lib/memex/accounts/user_token.ex index 74f387d..07aeba6 100644 --- a/lib/memex/accounts/user_token.ex +++ b/lib/memex/accounts/user_token.ex @@ -155,7 +155,7 @@ defmodule Memex.Accounts.UserToken do from t in __MODULE__, where: t.user_id == ^user.id end - def user_and_contexts_query(user, [_ | _] = contexts) do + def user_and_contexts_query(user, [_head | _rest] = contexts) do from t in __MODULE__, where: t.user_id == ^user.id and t.context in ^contexts end end diff --git a/lib/memex_web/controllers/user_reset_password_controller.ex b/lib/memex_web/controllers/user_reset_password_controller.ex index df8d61f..6d83552 100644 --- a/lib/memex_web/controllers/user_reset_password_controller.ex +++ b/lib/memex_web/controllers/user_reset_password_controller.ex @@ -40,7 +40,7 @@ defmodule MemexWeb.UserResetPasswordController do # leaked token giving the user access to the account. def update(conn, %{"user" => user_params}) do case Accounts.reset_user_password(conn.assigns.user, user_params) do - {:ok, _} -> + {:ok, _user} -> conn |> put_flash(:info, dgettext("prompts", "password reset successfully.")) |> redirect(to: ~p"/users/log_in") diff --git a/test/memex/accounts_test.exs b/test/memex/accounts_test.exs index bc927b4..4269c4b 100644 --- a/test/memex/accounts_test.exs +++ b/test/memex/accounts_test.exs @@ -316,7 +316,7 @@ defmodule Memex.AccountsTest do test "deletes all tokens for the given user", %{user: user} do _session_token = Accounts.generate_user_session_token(user) - {:ok, _} = + {:ok, _user} = Accounts.update_user_password(user, valid_user_password(), %{ "password" => "new valid password" }) diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 03d7088..ed308ce 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -64,7 +64,7 @@ defmodule Memex.DataCase do symbols = ~c"0123456789abcdef-" symbol_count = Enum.count(symbols) - for _ <- Range.new(1, length), + for _index <- 1..length//1, into: "", do: <> end diff --git a/test/support/fixtures.ex b/test/support/fixtures.ex index 83afbcd..a768766 100644 --- a/test/support/fixtures.ex +++ b/test/support/fixtures.ex @@ -47,8 +47,8 @@ defmodule Memex.Fixtures do |> Atom.to_string() |> Email.generate_email(Accounts.get_user!(user_id), attrs) - [_, html_token | _] = email.html_body |> String.split("[TOKEN]") - [_, text_token | _] = email.text_body |> String.split("[TOKEN]") + [_prefix, html_token | _postfix] = email.html_body |> String.split("[TOKEN]") + [_prefix, text_token | _postfix] = email.text_body |> String.split("[TOKEN]") ^text_token = html_token end