From 4b7a3ea0caedaf3a5e3d3bb2934220022de3286d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81=C4=99picki?= Date: Fri, 27 Dec 2024 16:03:48 +0100 Subject: [PATCH] Fix mistakes in type specs in the File module the mistakes were introduced in https://github.com/elixir-lang/elixir/pull/14121 --- lib/elixir/lib/file.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/elixir/lib/file.ex b/lib/elixir/lib/file.ex index 4773e6245a2..0c3e79931fb 100644 --- a/lib/elixir/lib/file.ex +++ b/lib/elixir/lib/file.ex @@ -1143,7 +1143,7 @@ defmodule File do Check `File.open/2` for other available options. """ @spec write(Path.t(), iodata, [mode]) :: - :ok | {:error, posix | :badarg, :terminated | :system_limit} + :ok | {:error, posix | :badarg | :terminated | :system_limit} def write(path, content, modes \\ []) do modes = normalize_modes(modes, false) :file.write_file(IO.chardata_to_string(path), content, modes) @@ -1599,7 +1599,7 @@ defmodule File do current directory. For this reason, returns `{:ok, cwd}` in case of success, `{:error, reason}` otherwise. """ - @spec cwd() :: {:ok, binary} | {:error, posix, :badarg} + @spec cwd() :: {:ok, binary} | {:error, posix | :badarg} def cwd() do case :file.get_cwd() do {:ok, base} -> {:ok, IO.chardata_to_string(fix_drive_letter(base))} @@ -1700,7 +1700,7 @@ defmodule File do Returns `{:ok, files}` in case of success, `{:error, reason}` otherwise. """ - @spec ls(Path.t()) :: {:ok, [binary]} | {:error, posix | :badarg, {:no_translation, binary}} + @spec ls(Path.t()) :: {:ok, [binary]} | {:error, posix | :badarg | {:no_translation, binary}} def ls(path \\ ".") do case :file.list_dir(IO.chardata_to_string(path)) do {:ok, file_list} -> {:ok, Enum.map(file_list, &IO.chardata_to_string/1)}