From add39509a20645905fbd4040b1739949fc447028 Mon Sep 17 00:00:00 2001 From: xensik Date: Sun, 3 Nov 2024 20:39:55 +0100 Subject: [PATCH] fix --- include/xsk/utils/file.hpp | 5 +---- include/xsk/utils/reader.hpp | 6 +----- include/xsk/utils/writer.hpp | 6 +----- include/xsk/utils/zlib.hpp | 5 +---- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/include/xsk/utils/file.hpp b/include/xsk/utils/file.hpp index dbfa765b..288df0e2 100644 --- a/include/xsk/utils/file.hpp +++ b/include/xsk/utils/file.hpp @@ -10,10 +10,7 @@ namespace xsk::utils struct file { - struct error : public std::runtime_error - { - explicit error(std::string const& message) : std::runtime_error(message) {} - }; + using error = std::runtime_error; static auto read(std::filesystem::path const& file) -> std::vector; static auto save(std::filesystem::path const& file, std::vector const& data) -> void; diff --git a/include/xsk/utils/reader.hpp b/include/xsk/utils/reader.hpp index dac13508..5a72e2c4 100644 --- a/include/xsk/utils/reader.hpp +++ b/include/xsk/utils/reader.hpp @@ -11,11 +11,7 @@ namespace xsk::utils struct reader { using ptr = std::unique_ptr; - - struct error : public std::runtime_error - { - explicit error(std::string const& message) : std::runtime_error(message) {} - }; + using error = std::runtime_error; private: u8 const* data_; diff --git a/include/xsk/utils/writer.hpp b/include/xsk/utils/writer.hpp index 8468e08f..c2ed782a 100644 --- a/include/xsk/utils/writer.hpp +++ b/include/xsk/utils/writer.hpp @@ -11,11 +11,7 @@ namespace xsk::utils struct writer { using ptr = std::unique_ptr; - - struct error : public std::runtime_error - { - explicit error(std::string const& message) : std::runtime_error(message) {} - }; + using error = std::runtime_error; private: static constexpr u32 default_size = 0x100000; diff --git a/include/xsk/utils/zlib.hpp b/include/xsk/utils/zlib.hpp index 88ac9064..e40bc2ee 100644 --- a/include/xsk/utils/zlib.hpp +++ b/include/xsk/utils/zlib.hpp @@ -10,10 +10,7 @@ namespace xsk::utils struct zlib { - struct error : public std::runtime_error - { - explicit error(std::string const& message) : std::runtime_error(message) {} - }; + using error = std::runtime_error; static auto compress(std::vector const& data) -> std::vector; static auto decompress(std::vector const& data, u32 length) -> std::vector;