Skip to content

Commit c34627c

Browse files
Fix type specs in the File module (#14123)
They were introduced in #14121.
1 parent 292f876 commit c34627c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/elixir/lib/file.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ defmodule File do
11431143
Check `File.open/2` for other available options.
11441144
"""
11451145
@spec write(Path.t(), iodata, [mode]) ::
1146-
:ok | {:error, posix | :badarg, :terminated | :system_limit}
1146+
:ok | {:error, posix | :badarg | :terminated | :system_limit}
11471147
def write(path, content, modes \\ []) do
11481148
modes = normalize_modes(modes, false)
11491149
:file.write_file(IO.chardata_to_string(path), content, modes)
@@ -1599,7 +1599,7 @@ defmodule File do
15991599
current directory. For this reason, returns `{:ok, cwd}` in case
16001600
of success, `{:error, reason}` otherwise.
16011601
"""
1602-
@spec cwd() :: {:ok, binary} | {:error, posix, :badarg}
1602+
@spec cwd() :: {:ok, binary} | {:error, posix | :badarg}
16031603
def cwd() do
16041604
case :file.get_cwd() do
16051605
{:ok, base} -> {:ok, IO.chardata_to_string(fix_drive_letter(base))}
@@ -1700,7 +1700,7 @@ defmodule File do
17001700
Returns `{:ok, files}` in case of success,
17011701
`{:error, reason}` otherwise.
17021702
"""
1703-
@spec ls(Path.t()) :: {:ok, [binary]} | {:error, posix | :badarg, {:no_translation, binary}}
1703+
@spec ls(Path.t()) :: {:ok, [binary]} | {:error, posix | :badarg | {:no_translation, binary}}
17041704
def ls(path \\ ".") do
17051705
case :file.list_dir(IO.chardata_to_string(path)) do
17061706
{:ok, file_list} -> {:ok, Enum.map(file_list, &IO.chardata_to_string/1)}

0 commit comments

Comments
 (0)