refactor(pages): string -> string_view

This commit is contained in:
Marcus Holland-Moritz 2024-11-19 23:23:45 +01:00
parent 56dedbd05e
commit 329d342e7e
2 changed files with 3 additions and 2 deletions

View File

@ -24,6 +24,7 @@
#include <filesystem> #include <filesystem>
#include <optional> #include <optional>
#include <string> #include <string>
#include <string_view>
#include <vector> #include <vector>
namespace dwarfs { namespace dwarfs {
@ -38,7 +39,7 @@ struct pager_program {
}; };
std::optional<pager_program> find_pager_program(os_access const& os); std::optional<pager_program> find_pager_program(os_access const& os);
void show_in_pager(pager_program const& pager, std::string text); void show_in_pager(pager_program const& pager, std::string_view text);
} // namespace tool } // namespace tool

View File

@ -78,7 +78,7 @@ std::optional<pager_program> find_pager_program(os_access const& os) {
return std::nullopt; return std::nullopt;
} }
void show_in_pager(pager_program const& pager, std::string text) { void show_in_pager(pager_program const& pager, std::string_view text) {
boost::asio::io_context ios; boost::asio::io_context ios;
// NOLINTBEGIN(clang-analyzer-unix.BlockInCriticalSection) // NOLINTBEGIN(clang-analyzer-unix.BlockInCriticalSection)
bp::child proc(pager.name.wstring(), bp::args(pager.args), bp::child proc(pager.name.wstring(), bp::args(pager.args),