| 1083 | // helper for StringFormatter |
| 1084 | template <typename Formatter, typename ScalarType> |
| 1085 | std::shared_ptr<Buffer> FormatToBuffer(Formatter&& formatter, const ScalarType& from) { |
| 1086 | if (!from.is_valid) { |
| 1087 | return Buffer::FromString("null"); |
| 1088 | } |
| 1089 | return formatter( |
| 1090 | from.value, [&](std::string_view v) { return Buffer::FromString(std::string(v)); }); |
| 1091 | } |
| 1092 | |
| 1093 | // error fallback |
| 1094 | template <typename To> |
no test coverage detected