Skip to content

Commit

Permalink
Use std::string_view in data_connection methods
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskovalchuk committed Aug 7, 2023
1 parent e5fb862 commit f936450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/ftp/include/ftp/detail/data_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "../transfer_callback.hpp"
#include <boost/asio/ip/tcp.hpp>
#include <memory>
#include <string_view>

namespace ftp::detail
{
Expand All @@ -43,9 +44,9 @@ class data_connection

data_connection & operator=(const data_connection &) = delete;

void open(const std::string & ip, std::uint16_t port);
void open(std::string_view ip, std::uint16_t port);

void listen(const std::string & ip, std::uint16_t port);
void listen(std::string_view ip, std::uint16_t port);

void accept();

Expand Down
4 changes: 2 additions & 2 deletions src/ftp/src/data_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data_connection::data_connection()
{
}

void data_connection::open(const std::string & ip, std::uint16_t port)
void data_connection::open(std::string_view ip, std::uint16_t port)
{
boost::system::error_code ec;

Expand Down Expand Up @@ -67,7 +67,7 @@ void data_connection::open(const std::string & ip, std::uint16_t port)
}
}

void data_connection::listen(const std::string & ip, std::uint16_t port)
void data_connection::listen(std::string_view ip, std::uint16_t port)
{
boost::system::error_code ec;

Expand Down

0 comments on commit f936450

Please sign in to comment.