ソースを参照

lib/mix/tasks/relay*: Use a with block

tags/v0.9.9
Haelwenn (lanodan) Monnier 5年前
コミット
44b6200103
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: D5B7A8E43C997DEE
2個のファイルの変更4行の追加8行の削除
  1. +2
    -4
      lib/mix/tasks/relay_follow.ex
  2. +2
    -4
      lib/mix/tasks/relay_unfollow.ex

+ 2
- 4
lib/mix/tasks/relay_follow.ex ファイルの表示

@@ -14,13 +14,11 @@ defmodule Mix.Tasks.RelayFollow do
def run([target]) do
Mix.Task.run("app.start")

{status, message} = Relay.follow(target)

if :ok == status do
with {:ok, activity} <- Relay.follow(target) do
# put this task to sleep to allow the genserver to push out the messages
:timer.sleep(500)
else
Mix.puts("Error: #{inspect(message)}")
{:error, e} -> Mix.shell().error("Error while following #{target}: #{inspect(e)}")
end
end
end

+ 2
- 4
lib/mix/tasks/relay_unfollow.ex ファイルの表示

@@ -13,13 +13,11 @@ defmodule Mix.Tasks.RelayUnfollow do
def run([target]) do
Mix.Task.run("app.start")

{status, message} = Relay.unfollow(target)

if :ok == status do
with {:ok, activity} <- Relay.follow(target) do
# put this task to sleep to allow the genserver to push out the messages
:timer.sleep(500)
else
Mix.puts("Error: #{inspect(message)}")
{:error, e} -> Mix.shell().error("Error while following #{target}: #{inspect(e)}")
end
end
end

読み込み中…
キャンセル
保存