avoid nodiscard compiler warnings

We got a lot of the warnings for unchecked Result / tl::expected; let's
handle those.
This commit is contained in:
Dirk-Jan C. Binnema
2026-08-09 18:26:42 +03:00
committed by Seth Ladygo
parent 7e32324ac4
commit 36d45b38af
11 changed files with 82 additions and 29 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2019-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2019-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify it
** under the terms of the GNU General Public License as published by the
@ -107,7 +107,7 @@ struct Error final : public std::exception {
*
* @return
*/
virtual const char* what() const noexcept override { return what_.c_str(); }
const char* what() const noexcept override { return what_.c_str(); }
/**
* Get the error-code for this error
@ -183,7 +183,10 @@ private:
std::string hint_;
};
inline auto
/**
* Make Error formattable with libfmt
*/
inline std::string
format_as(const Error& err) {
return mu_format("<{} ({}:{})>",
err.what(),