From 3e2407d7656c7145444772bbd6f4ccdf3d88f088 Mon Sep 17 00:00:00 2001 From: frtget <96221162+frtget@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:54:39 -0400 Subject: [PATCH] remove unnecessary includes and type aliases --- include/session/config/groups/info.h | 1 - include/session/config/groups/keys.hpp | 1 - include/session/xed25519.hpp | 4 ++-- src/config/contacts.cpp | 2 -- src/config/groups/info.cpp | 1 - src/xed25519.cpp | 2 +- tests/test_xed25519.cpp | 2 +- tests/utils.hpp | 6 +++--- 8 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/session/config/groups/info.h b/include/session/config/groups/info.h index 0f18ec5a..507939ce 100644 --- a/include/session/config/groups/info.h +++ b/include/session/config/groups/info.h @@ -6,7 +6,6 @@ extern "C" { #include "../base.h" #include "../profile_pic.h" -#include "../util.h" LIBSESSION_EXPORT extern const size_t GROUP_INFO_NAME_MAX_LENGTH; LIBSESSION_EXPORT extern const size_t GROUP_INFO_DESCRIPTION_MAX_LENGTH; diff --git a/include/session/config/groups/keys.hpp b/include/session/config/groups/keys.hpp index df47d8ae..b1dd3ff4 100644 --- a/include/session/config/groups/keys.hpp +++ b/include/session/config/groups/keys.hpp @@ -7,7 +7,6 @@ #include "../../config.hpp" #include "../base.hpp" #include "../namespaces.hpp" -#include "../profile_pic.hpp" #include "members.hpp" namespace session::config::groups { diff --git a/include/session/xed25519.hpp b/include/session/xed25519.hpp index e389e9d0..3c6fe9ab 100644 --- a/include/session/xed25519.hpp +++ b/include/session/xed25519.hpp @@ -3,9 +3,9 @@ #include #include -namespace session::xed25519 { +#include "session/types.hpp" -using ustring_view = std::basic_string_view; +namespace session::xed25519 { /// XEd25519-signs a message given the curve25519 privkey and message. std::array sign( diff --git a/src/config/contacts.cpp b/src/config/contacts.cpp index fa61e1ed..af44f06b 100644 --- a/src/config/contacts.cpp +++ b/src/config/contacts.cpp @@ -7,10 +7,8 @@ #include "internal.hpp" #include "session/config/contacts.h" -#include "session/config/error.h" #include "session/export.h" #include "session/types.hpp" -#include "session/util.hpp" using namespace std::literals; using namespace session::config; diff --git a/src/config/groups/info.cpp b/src/config/groups/info.cpp index 098d5c4e..db2fdc14 100644 --- a/src/config/groups/info.cpp +++ b/src/config/groups/info.cpp @@ -10,7 +10,6 @@ #include "session/config/groups/info.h" #include "session/export.h" #include "session/types.hpp" -#include "session/util.hpp" using namespace std::literals; diff --git a/src/xed25519.cpp b/src/xed25519.cpp index 66663242..2b2c0426 100644 --- a/src/xed25519.cpp +++ b/src/xed25519.cpp @@ -151,7 +151,7 @@ std::string pubkey(std::string_view curve25519_pubkey) { } // namespace session::xed25519 -using session::xed25519::ustring_view; +using session::ustring_view; extern "C" { diff --git a/tests/test_xed25519.cpp b/tests/test_xed25519.cpp index 67089302..3967208d 100644 --- a/tests/test_xed25519.cpp +++ b/tests/test_xed25519.cpp @@ -7,7 +7,7 @@ #include "session/xed25519.h" #include "session/xed25519.hpp" -using session::xed25519::ustring_view; +using session::ustring_view; constexpr std::array seed1{ 0xfe, 0xcd, 0x9a, 0x60, 0x34, 0xbc, 0x9a, 0xba, 0x27, 0x39, 0x25, 0xde, 0xe7, diff --git a/tests/utils.hpp b/tests/utils.hpp index 76b145c1..5d1e1c1b 100644 --- a/tests/utils.hpp +++ b/tests/utils.hpp @@ -10,10 +10,10 @@ #include #include -#include "session/config/base.h" +#include "session/types.hpp" -using ustring = std::basic_string; -using ustring_view = std::basic_string_view; +using session::ustring; +using session::ustring_view; inline ustring operator""_bytes(const char* x, size_t n) { return {reinterpret_cast(x), n};