Add lifetimebound to absl::StripAsciiWhitespace PiperOrigin-RevId: 728581017 Change-Id: I416b595ccf76c8fdc90cf7feb3d3bb27d502b013
diff --git a/absl/strings/ascii.h b/absl/strings/ascii.h index d9317eb..982e86f 100644 --- a/absl/strings/ascii.h +++ b/absl/strings/ascii.h
@@ -237,7 +237,7 @@ // Returns absl::string_view with whitespace stripped from the beginning of the // given string_view. ABSL_MUST_USE_RESULT inline absl::string_view StripLeadingAsciiWhitespace( - absl::string_view str) { + absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) { auto it = std::find_if_not(str.begin(), str.end(), absl::ascii_isspace); return str.substr(static_cast<size_t>(it - str.begin())); } @@ -251,7 +251,7 @@ // Returns absl::string_view with whitespace stripped from the end of the given // string_view. ABSL_MUST_USE_RESULT inline absl::string_view StripTrailingAsciiWhitespace( - absl::string_view str) { + absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) { auto it = std::find_if_not(str.rbegin(), str.rend(), absl::ascii_isspace); return str.substr(0, static_cast<size_t>(str.rend() - it)); } @@ -265,7 +265,7 @@ // Returns absl::string_view with whitespace stripped from both ends of the // given string_view. ABSL_MUST_USE_RESULT inline absl::string_view StripAsciiWhitespace( - absl::string_view str) { + absl::string_view str ABSL_ATTRIBUTE_LIFETIME_BOUND) { return StripTrailingAsciiWhitespace(StripLeadingAsciiWhitespace(str)); }