summaryrefslogtreecommitdiff
path: root/absl/strings/strip.h
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2018-01-03 09:52:58 -0800
committerGravatar Jon Cohen <cohenjon@google.com>2018-01-03 17:34:42 -0500
commit0271cd35577599fa99b59202da17d3136956e4c0 (patch)
treef8edb7f43c66b34be85368a89414882870ebee0b /absl/strings/strip.h
parent6365d1744b405cec48317e9597a80533acab0798 (diff)
Changes imported from Abseil "staging" branch:
- 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Add ABSL_MUST_USE_RESULT to absl::StripPrefix and absl::S... by Mark Barolak <mbar@google.com> - 47d8de97748da346ad2a962f27389e0380a7a716 Fix missing header include when compiling with _GLIBCXX_D... by Alex Strelnikov <strel@google.com> GitOrigin-RevId: 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Change-Id: I8698c77d9eab81455b209a6bef4bb2d5b32ebd65
Diffstat (limited to 'absl/strings/strip.h')
-rw-r--r--absl/strings/strip.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/strings/strip.h b/absl/strings/strip.h
index 370f9e88..2f8d21f7 100644
--- a/absl/strings/strip.h
+++ b/absl/strings/strip.h
@@ -67,8 +67,8 @@ inline bool ConsumeSuffix(absl::string_view* str, absl::string_view expected) {
// Returns a view into the input std::string 'str' with the given 'prefix' removed,
// but leaving the original std::string intact. If the prefix does not match at the
// start of the std::string, returns the original std::string instead.
-inline absl::string_view StripPrefix(absl::string_view str,
- absl::string_view prefix) {
+ABSL_MUST_USE_RESULT inline absl::string_view StripPrefix(
+ absl::string_view str, absl::string_view prefix) {
if (absl::StartsWith(str, prefix)) str.remove_prefix(prefix.size());
return str;
}
@@ -78,8 +78,8 @@ inline absl::string_view StripPrefix(absl::string_view str,
// Returns a view into the input std::string 'str' with the given 'suffix' removed,
// but leaving the original std::string intact. If the suffix does not match at the
// end of the std::string, returns the original std::string instead.
-inline absl::string_view StripSuffix(absl::string_view str,
- absl::string_view suffix) {
+ABSL_MUST_USE_RESULT inline absl::string_view StripSuffix(
+ absl::string_view str, absl::string_view suffix) {
if (absl::EndsWith(str, suffix)) str.remove_suffix(suffix.size());
return str;
}