Skip to content

Commit

Permalink
Remove unused vars and aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Dylan Kendal committed Aug 10, 2016
1 parent 4b7e116 commit 2e4a310
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lib/battle_snake/game_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule BattleSnake.GameServer do
{:reply, :ok, {:halted, state}}
end

def handle_call(:prev, from, {_, state}) do
def handle_call(:prev, _from, {_, state}) do
state = state
|> step_back()
{:reply, :ok, {:suspend, state}}
Expand Down
10 changes: 5 additions & 5 deletions lib/battle_snake/world.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule BattleSnake.World do
alias BattleSnake.{Snake, Board, Point}
alias BattleSnake.{Snake, Point}

defstruct [
food: [],
Expand Down Expand Up @@ -35,7 +35,7 @@ defmodule BattleSnake.World do
end
end

def tick(%{"snakes" => []} = world, previous) do
def tick(%{"snakes" => []}, _) do
:ok
end

Expand Down Expand Up @@ -113,7 +113,7 @@ defmodule BattleSnake.World do
end

def grow_snakes world do
world = update_in world.snakes, fn snakes ->
update_in world.snakes, fn snakes ->
for snake <- snakes do
increase = grew(world, snake)
Snake.grow(snake, increase)
Expand Down Expand Up @@ -159,11 +159,11 @@ defmodule BattleSnake.World do
end

def cols(world) do
cols = 0..(world.width - 1)
0..(world.width - 1)
end

def rows(world) do
rows = 0..(world.height - 1)
0..(world.height - 1)
end

def map(world, f) do
Expand Down
11 changes: 0 additions & 11 deletions priv/gettext/en/LC_MESSAGES/errors.po
Original file line number Diff line number Diff line change
@@ -1,11 +0,0 @@
## `msgid`s in this file come from POT (.pot) files.
##
## Do not add, change, or remove `msgid`s manually here as
## they're tied to the ones in the corresponding POT file
## (with the same domain).
##
## Use `mix gettext.extract --merge` or `mix gettext.merge`
## to merge POT files into PO files.
msgid ""
msgstr ""
"Language: en\n"
10 changes: 0 additions & 10 deletions priv/gettext/errors.pot
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
## This file is a PO Template file.
##
## `msgid`s here are often extracted from source code.
## Add new translations manually only if they're dynamic
## translations that can't be statically extracted.
##
## Run `mix gettext.extract` to bring this file up to
## date. Leave `msgstr`s empty as changing them here as no
## effect: edit them in PO (`.po`) files instead.

11 changes: 5 additions & 6 deletions web/channels/game_channel.ex
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
defmodule BattleSnakeServer.GameChannel do
@api Application.get_env(:battle_snake_server, :snake_api)

alias BattleSnake.{Snake, World, GameServer}
alias BattleSnake.{World, GameServer}
alias BattleSnakeServer.{Game}

use BattleSnakeServer.Web, :channel

def join("game:" <> game_id, payload, socket) do
def join("game:" <> _id, payload, socket) do
if authorized?(payload) do
{:ok, socket}
else
Expand Down Expand Up @@ -96,12 +96,11 @@ defmodule BattleSnakeServer.GameChannel do
objective: &BattleSnake.WinConditions.single_player/1
]

reducer = reducer(socket)
on_change = draw(socket)

state = %GameServer.State{
%GameServer.State{
world: world,
reducer: reducer,
reducer: reducer(),
opts: opts,
on_change: on_change,
}
Expand Down Expand Up @@ -136,7 +135,7 @@ defmodule BattleSnakeServer.GameChannel do
end
end

def reducer(socket) do
def reducer do
fn world ->
world = update_in(world.turn, &(&1+1))

Expand Down
4 changes: 2 additions & 2 deletions web/controllers/game_controller.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule BattleSnakeServer.GameController do
use BattleSnakeServer.Web, :controller

alias BattleSnakeServer.{Game, World}
alias BattleSnakeServer.Game

def index(conn, _params) do
games = Game.all
Expand Down Expand Up @@ -47,7 +47,7 @@ defmodule BattleSnakeServer.GameController do
redirect(conn, to: game_path(conn, :edit, game))
end

def delete(conn, %{"id" => id}) do
def delete(_conn, %{"id" => _id}) do
end

def create_params(params) do
Expand Down

0 comments on commit 2e4a310

Please sign in to comment.