ljust is being deprecated
This commit is contained in:
@@ -4,7 +4,7 @@ defmodule Display.ProgressBar do
|
|||||||
def progress_bar(%{current: current, total: total}) do
|
def progress_bar(%{current: current, total: total}) do
|
||||||
arrow = calculate_progress(current, total) |> build_arrow
|
arrow = calculate_progress(current, total) |> build_arrow
|
||||||
|
|
||||||
"|" <> String.ljust(arrow, @progress_bar_length) <> "| #{current} of #{total}"
|
"|" <> String.pad_trailing(arrow, @progress_bar_length) <> "| #{current} of #{total}"
|
||||||
end
|
end
|
||||||
|
|
||||||
defp calculate_progress(current, total) do
|
defp calculate_progress(current, total) do
|
||||||
|
|||||||
Reference in New Issue
Block a user