From 5d9c3a0e71ba541d8b00874f174f35c08396665a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 1 Mar 2026 00:23:05 -1000 Subject: [PATCH] Fix clang-tidy: use make_unique and fix include order - Replace std::unique_ptr{new ...} with make_unique - Fix include order to satisfy clang-format --- esphome/components/socket/bsd_sockets_impl.cpp | 4 ++-- esphome/components/socket/lwip_sockets_impl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/socket/bsd_sockets_impl.cpp b/esphome/components/socket/bsd_sockets_impl.cpp index efbb64990c9..92ecfc692b8 100644 --- a/esphome/components/socket/bsd_sockets_impl.cpp +++ b/esphome/components/socket/bsd_sockets_impl.cpp @@ -1,6 +1,6 @@ -#include "socket.h" #include "esphome/core/defines.h" #include "esphome/core/helpers.h" +#include "socket.h" #ifdef USE_SOCKET_IMPL_BSD_SOCKETS @@ -75,7 +75,7 @@ static std::unique_ptr create_socket(int domain, int type, int pr int ret = ::socket(domain, type, protocol); if (ret == -1) return nullptr; - return std::unique_ptr{new BSDSocketImpl(ret, loop_monitored)}; + return make_unique(ret, loop_monitored); } std::unique_ptr socket(int domain, int type, int protocol) { diff --git a/esphome/components/socket/lwip_sockets_impl.cpp b/esphome/components/socket/lwip_sockets_impl.cpp index 8a926c92ea3..0322820ef43 100644 --- a/esphome/components/socket/lwip_sockets_impl.cpp +++ b/esphome/components/socket/lwip_sockets_impl.cpp @@ -1,6 +1,6 @@ -#include "socket.h" #include "esphome/core/defines.h" #include "esphome/core/helpers.h" +#include "socket.h" #ifdef USE_SOCKET_IMPL_LWIP_SOCKETS @@ -75,7 +75,7 @@ static std::unique_ptr create_socket(int domain, int type, int p int ret = lwip_socket(domain, type, protocol); if (ret == -1) return nullptr; - return std::unique_ptr{new LwIPSocketImpl(ret, loop_monitored)}; + return make_unique(ret, loop_monitored); } std::unique_ptr socket(int domain, int type, int protocol) {