diff --git a/src/net/ToString.hxx b/src/net/ToString.hxx
index 4d92c408c..939efcf51 100644
--- a/src/net/ToString.hxx
+++ b/src/net/ToString.hxx
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: BSD-2-Clause
 // author: Max Kellermann <max.kellermann@gmail.com>
 
-#ifndef NET_TO_STRING_HXX
-#define NET_TO_STRING_HXX
+#pragma once
 
 #include <string>
 
@@ -23,5 +22,3 @@ ToString(SocketAddress address) noexcept;
 [[gnu::pure]]
 std::string
 HostToString(SocketAddress address) noexcept;
-
-#endif