Skip to content

Remove qualified call in IO.ANSI#15430

Merged
josevalim merged 2 commits into
elixir-lang:mainfrom
RaymondLoranger:remove-dead-code
Jun 1, 2026
Merged

Remove qualified call in IO.ANSI#15430
josevalim merged 2 commits into
elixir-lang:mainfrom
RaymondLoranger:remove-dead-code

Conversation

@RaymondLoranger
Copy link
Copy Markdown
Contributor

The qualified call IO.ANSI.reset() is unnecessary => just reset() will do.
And the line format_sequence(term) is also unnecessary. This line was added in v1.16 for some reason.

Comment thread lib/elixir/lib/io/ansi.ex
end

defp do_format(term, rem, acc, false, append_reset) when is_atom(term) do
format_sequence(term)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call is necessary so it raises in case the atom is invalid. Perhaps we should add a test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a test? What about the IO.ANSI.reset qualified call?

Comment thread lib/elixir/lib/io/ansi.ex
@josevalim josevalim changed the title Removed dead code and qualified call Remove qualified call in IO.ANSI Jun 1, 2026
@josevalim josevalim merged commit 55da97b into elixir-lang:main Jun 1, 2026
15 checks passed
@josevalim
Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants