From af6bb9325d168abd57168d8173e79a8f75a38943 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Tue, 19 Nov 2024 23:23:45 +0100 Subject: [PATCH] refactor(pages): string -> string_view --- include/dwarfs/tool/pager.h | 3 ++- src/tool/pager.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/dwarfs/tool/pager.h b/include/dwarfs/tool/pager.h index 493970b9..5e236290 100644 --- a/include/dwarfs/tool/pager.h +++ b/include/dwarfs/tool/pager.h @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace dwarfs { @@ -38,7 +39,7 @@ struct pager_program { }; std::optional 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 diff --git a/src/tool/pager.cpp b/src/tool/pager.cpp index 21f1849a..1d7ed2c1 100644 --- a/src/tool/pager.cpp +++ b/src/tool/pager.cpp @@ -78,7 +78,7 @@ std::optional find_pager_program(os_access const& os) { 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; // NOLINTBEGIN(clang-analyzer-unix.BlockInCriticalSection) bp::child proc(pager.name.wstring(), bp::args(pager.args),