mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 01:32:14 -05:00
AK: Make Formatter<StringView> not choke on Mode::Character
Formatter<char> internally uses Formatter<StringView> when in Mode::Character, but that would only accept Mode::{Default,String} and ASSERT_NOT_REACHED() otherwise, causing String::formatted("{:c}", 'a') to crash
This commit is contained in:
parent
99a6c4ce42
commit
2313e58393
Notes:
sideshowbarker
2024-07-19 01:01:18 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/2313e583930 Pull-request: https://github.com/SerenityOS/serenity/pull/4343
1 changed files with 1 additions and 1 deletions
|
@ -522,7 +522,7 @@ void Formatter<StringView>::format(TypeErasedFormatParams& params, FormatBuilder
|
|||
ASSERT_NOT_REACHED();
|
||||
if (m_zero_pad)
|
||||
ASSERT_NOT_REACHED();
|
||||
if (m_mode != Mode::Default && m_mode != Mode::String)
|
||||
if (m_mode != Mode::Default && m_mode != Mode::String && m_mode != Mode::Character)
|
||||
ASSERT_NOT_REACHED();
|
||||
if (m_width != value_not_set && m_precision != value_not_set)
|
||||
ASSERT_NOT_REACHED();
|
||||
|
|
Loading…
Reference in a new issue