Commit d2331436 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

private inheritance for formatter<fbstring>

Summary: And other fixes. Because Hyrum's Law comes for all.

Reviewed By: vitaut

Differential Revision: D34010783

fbshipit-source-id: 95c56f24ef4b129b2758d4ec465366cd09acac93
parent 8a17d8d1
...@@ -2733,7 +2733,9 @@ struct IsSomeString<fbstring> : std::true_type {}; ...@@ -2733,7 +2733,9 @@ struct IsSomeString<fbstring> : std::true_type {};
} // namespace folly } // namespace folly
template <> template <>
struct fmt::formatter<folly::fbstring> : formatter<fmt::string_view> { struct fmt::formatter<folly::fbstring> : private formatter<fmt::string_view> {
using formatter<fmt::string_view>::parse;
template <typename Context> template <typename Context>
typename Context::iterator format( typename Context::iterator format(
const folly::fbstring& s, Context& ctx) const { const folly::fbstring& s, Context& ctx) const {
......
...@@ -1554,7 +1554,7 @@ struct formatter<folly::StringPiece> : private formatter<string_view> { ...@@ -1554,7 +1554,7 @@ struct formatter<folly::StringPiece> : private formatter<string_view> {
using formatter<string_view>::parse; using formatter<string_view>::parse;
template <typename Context> template <typename Context>
auto format(folly::StringPiece s, Context& ctx) { typename Context::iterator format(folly::StringPiece s, Context& ctx) const {
return formatter<string_view>::format({s.data(), s.size()}, ctx); return formatter<string_view>::format({s.data(), s.size()}, ctx);
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment