mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 18:48:39 +00:00
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
This commit is contained in:
@@ -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<BSDSocketImpl> create_socket(int domain, int type, int pr
|
||||
int ret = ::socket(domain, type, protocol);
|
||||
if (ret == -1)
|
||||
return nullptr;
|
||||
return std::unique_ptr<BSDSocketImpl>{new BSDSocketImpl(ret, loop_monitored)};
|
||||
return make_unique<BSDSocketImpl>(ret, loop_monitored);
|
||||
}
|
||||
|
||||
std::unique_ptr<Socket> socket(int domain, int type, int protocol) {
|
||||
|
||||
@@ -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<LwIPSocketImpl> create_socket(int domain, int type, int p
|
||||
int ret = lwip_socket(domain, type, protocol);
|
||||
if (ret == -1)
|
||||
return nullptr;
|
||||
return std::unique_ptr<LwIPSocketImpl>{new LwIPSocketImpl(ret, loop_monitored)};
|
||||
return make_unique<LwIPSocketImpl>(ret, loop_monitored);
|
||||
}
|
||||
|
||||
std::unique_ptr<Socket> socket(int domain, int type, int protocol) {
|
||||
|
||||
Reference in New Issue
Block a user