@@ -34,8 +34,8 @@ namespace pw {
34
34
namespace string {
35
35
namespace internal {
36
36
37
- PW_CONSTEXPR_CPP20 inline StatusWithSize CopyToSpan (
38
- const std::string_view& source, span<char > dest) {
37
+ PW_CONSTEXPR_CPP20 inline StatusWithSize CopyToSpan (std::string_view source,
38
+ span<char > dest) {
39
39
if (dest.empty ()) {
40
40
return StatusWithSize::ResourceExhausted ();
41
41
}
@@ -117,7 +117,7 @@ constexpr Result<size_t> NullTerminatedLength(const char* str, size_t max_len) {
117
117
// /
118
118
// / @endrst
119
119
template <typename Span>
120
- PW_CONSTEXPR_CPP20 inline StatusWithSize Copy (const std::string_view& source,
120
+ PW_CONSTEXPR_CPP20 inline StatusWithSize Copy (std::string_view source,
121
121
Span&& dest) {
122
122
static_assert (
123
123
!std::is_base_of_v<InlineString<>, std::decay_t <Span>>,
@@ -155,7 +155,7 @@ PW_CONSTEXPR_CPP20 inline StatusWithSize Copy(const char* source,
155
155
// / RESOURCE_EXHAUSTED: The ``std::string_view`` was truncated to fit.
156
156
// /
157
157
// / @endrst
158
- inline Status Assign (InlineString<>& string, const std::string_view& view) {
158
+ inline Status Assign (InlineString<>& string, std::string_view view) {
159
159
const size_t chars_copied =
160
160
std::min (view.size (), static_cast <size_t >(string.capacity ()));
161
161
string.assign (view, 0 , static_cast <string_impl::size_type>(chars_copied));
@@ -182,7 +182,7 @@ inline Status Assign(InlineString<>& string, const char* c_string) {
182
182
// / RESOURCE_EXHAUSTED: The ``std::string_view`` was truncated to fit.
183
183
// /
184
184
// / @endrst
185
- inline Status Append (InlineString<>& string, const std::string_view& view) {
185
+ inline Status Append (InlineString<>& string, std::string_view view) {
186
186
const size_t chars_copied = std::min (
187
187
view.size (), static_cast <size_t >(string.capacity () - string.size ()));
188
188
string.append (view, 0 , static_cast <string_impl::size_type>(chars_copied));
@@ -200,8 +200,8 @@ inline Status Append(InlineString<>& string, const char* c_string) {
200
200
// / Copies the `source` string to the `dest` string with same behavior as
201
201
// / `pw::string::Copy`, with the difference that any non-printable characters
202
202
// / are changed to `.`.
203
- PW_CONSTEXPR_CPP20 inline StatusWithSize PrintableCopy (
204
- const std::string_view& source, span<char > dest) {
203
+ PW_CONSTEXPR_CPP20 inline StatusWithSize PrintableCopy (std::string_view source,
204
+ span<char > dest) {
205
205
StatusWithSize copy_result = Copy (source, dest);
206
206
for (size_t i = 0 ; i < copy_result.size (); i++) {
207
207
dest[i] = std::isprint (dest[i]) ? dest[i] : ' .' ;
0 commit comments