mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibWeb: Convert CSS Token/ComponentValue::to_debug_string() to String
These are only used for debugging, so I've decided that logging the ErrorOr<String> itself is fine instead of trying to handle that error more gracefully in those cases. If you're getting OOM trying to debug log things, you have bigger problems.
This commit is contained in:
parent
7fc72d3838
commit
2368e6c5f2
4 changed files with 35 additions and 35 deletions
|
@ -34,17 +34,17 @@ DeprecatedString ComponentValue::to_deprecated_string() const
|
|||
[](NonnullRefPtr<Function> const& function) { return function->to_deprecated_string(); });
|
||||
}
|
||||
|
||||
DeprecatedString ComponentValue::to_debug_string() const
|
||||
ErrorOr<String> ComponentValue::to_debug_string() const
|
||||
{
|
||||
return m_value.visit(
|
||||
[](Token const& token) {
|
||||
return DeprecatedString::formatted("Token: {}", token.to_debug_string());
|
||||
[](Token const& token) -> ErrorOr<String> {
|
||||
return String::formatted("Token: {}", TRY(token.to_debug_string()));
|
||||
},
|
||||
[](NonnullRefPtr<Block> const& block) {
|
||||
return DeprecatedString::formatted("Block: {}", block->to_deprecated_string());
|
||||
[](NonnullRefPtr<Block> const& block) -> ErrorOr<String> {
|
||||
return String::formatted("Block: {}", block->to_deprecated_string());
|
||||
},
|
||||
[](NonnullRefPtr<Function> const& function) {
|
||||
return DeprecatedString::formatted("Function: {}", function->to_deprecated_string());
|
||||
[](NonnullRefPtr<Function> const& function) -> ErrorOr<String> {
|
||||
return String::formatted("Function: {}", function->to_deprecated_string());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue