AK: Let FlyStrings be assigned from Strings

This commit is contained in:
Sam Atkins 2023-02-14 14:21:55 +00:00 committed by Tim Flynn
parent abc01cc9fe
commit a35fa553dd
Notes: sideshowbarker 2024-07-17 03:05:16 +09:00
2 changed files with 7 additions and 0 deletions

View file

@ -53,6 +53,12 @@ FlyString::FlyString(String const& string)
String::ref_fly_string_data({}, m_data);
}
FlyString& FlyString::operator=(String const& string)
{
*this = FlyString { string };
return *this;
}
FlyString::FlyString(FlyString const& other)
: m_data(other.m_data)
{

View file

@ -22,6 +22,7 @@ public:
static ErrorOr<FlyString> from_utf8(StringView);
explicit FlyString(String const&);
FlyString& operator=(String const&);
FlyString(FlyString const&);
FlyString& operator=(FlyString const&);