From 5e492d33be3962c4889867c6691aca7f94d2637f Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Thu, 27 Jul 2023 21:38:46 +0000 Subject: [PATCH] Use std::string_view instead of base::StringPiece Based on crrev.com/c/4294483, it sounds like the current guideline is to use `std::string_view`. Bug: None Change-Id: I5e5f6baa6ca45ab0ef79f6021a8fde0434b5f333 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4724955 Reviewed-by: danakj Reviewed-by: David Benjamin Commit-Queue: Hong Xu Cr-Commit-Position: refs/heads/main@{#1176298} --- styleguide/c++/c++-features.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/styleguide/c++/c++-features.md b/styleguide/c++/c++-features.md index 2767b72e28a54d..771bbb7f46e7c8 100644 --- a/styleguide/c++/c++-features.md +++ b/styleguide/c++/c++-features.md @@ -1719,10 +1719,7 @@ absl::string_view *** promo Originally banned due to only working with 8-bit characters. Now it is unnecessary because, in Chromium, it is the same type as `std::string_view`. -Use `base::StringPiece` from `base/strings/`, unless interfacing with -third-party code, in which case prefer to write the type as `std::string_view`. -Note `base::StringPiece` implicitly converts to and from `std::string_view`, so -one typically does not need to write the STL name. +Please use `std::string_view` instead. *** ### Strings Library [banned]