From 0271cd35577599fa99b59202da17d3136956e4c0 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 3 Jan 2018 09:52:58 -0800 Subject: Changes imported from Abseil "staging" branch: - 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Add ABSL_MUST_USE_RESULT to absl::StripPrefix and absl::S... by Mark Barolak - 47d8de97748da346ad2a962f27389e0380a7a716 Fix missing header include when compiling with _GLIBCXX_D... by Alex Strelnikov GitOrigin-RevId: 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Change-Id: I8698c77d9eab81455b209a6bef4bb2d5b32ebd65 --- absl/strings/strip.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'absl/strings/strip.h') diff --git a/absl/strings/strip.h b/absl/strings/strip.h index 370f9e88f0d6..2f8d21f7deb9 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; } -- cgit 1.4.1