mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 17:25:10 +00:00
LibSQL: Remove infallible type conversions from SQL::Value
Force the callers to either know that the type is convertible, or to handle the conversion failure.
This commit is contained in:
parent
af3980384b
commit
7d41b46a7d
8 changed files with 22 additions and 64 deletions
|
@ -189,39 +189,6 @@ Optional<Vector<Value>> Value::to_vector() const
|
|||
return {};
|
||||
}
|
||||
|
||||
Value::operator String() const
|
||||
{
|
||||
return to_string();
|
||||
}
|
||||
|
||||
Value::operator int() const
|
||||
{
|
||||
auto i = to_int();
|
||||
VERIFY(i.has_value());
|
||||
return i.value();
|
||||
}
|
||||
|
||||
Value::operator u32() const
|
||||
{
|
||||
auto i = to_u32();
|
||||
VERIFY(i.has_value());
|
||||
return i.value();
|
||||
}
|
||||
|
||||
Value::operator double() const
|
||||
{
|
||||
auto d = to_double();
|
||||
VERIFY(d.has_value());
|
||||
return d.value();
|
||||
}
|
||||
|
||||
Value::operator bool() const
|
||||
{
|
||||
auto b = to_bool();
|
||||
VERIFY(b.has_value());
|
||||
return b.value();
|
||||
}
|
||||
|
||||
void Value::assign(Value const& other_value)
|
||||
{
|
||||
m_impl.visit([&](auto& impl) { impl.assign(other_value); });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue