瀏覽代碼

AK: Add formatter for URL.

asynts 4 年之前
父節點
當前提交
b23f66e151
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      AK/URL.h

+ 8 - 0
AK/URL.h

@@ -102,6 +102,14 @@ inline const LogStream& operator<<(const LogStream& stream, const URL& value)
     return stream << value.to_string();
 }
 
+template<>
+struct Formatter<URL> : Formatter<StringView> {
+    void format(TypeErasedFormatParams& params, FormatBuilder& builder, const URL& value)
+    {
+        Formatter<StringView>::format(params, builder, value.to_string());
+    }
+};
+
 template<>
 struct Traits<URL> : public GenericTraits<URL> {
     static unsigned hash(const URL& url) { return url.to_string().hash(); }