From 6663cca653496eddb714aa0a32b134e93e74eb62 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 6 Jan 2020 09:11:32 +0100 Subject: [PATCH] Change signature of Instance. --- include/instance.hpp | 3 ++- src/instance.cpp | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/instance.hpp b/include/instance.hpp index f80e201..17425cd 100644 --- a/include/instance.hpp +++ b/include/instance.hpp @@ -50,7 +50,8 @@ public: * * @since 0.1.0 */ - explicit Instance(string hostname, string access_token); + explicit Instance(const string_view &hostname, + const string_view &access_token); /*! * @brief Returns the hostname. diff --git a/src/instance.cpp b/src/instance.cpp index 15783ad..c765345 100644 --- a/src/instance.cpp +++ b/src/instance.cpp @@ -18,18 +18,15 @@ #include "log.hpp" #include "return_types.hpp" -#include - namespace mastodonpp { using std::stoull; -using std::move; -Instance::Instance(string hostname, string access_token) - : _hostname{move(hostname)} +Instance::Instance(const string_view &hostname, const string_view &access_token) + : _hostname{hostname} , _baseuri{"https://" + _hostname} - , _access_token{move(access_token)} + , _access_token{access_token} , _max_chars{500} { try