summaryrefslogtreecommitdiff
path: root/absl/strings/str_replace.cc
diff options
context:
space:
mode:
authorGravatar Dmitri Gribenko <dmitrig@google.com>2023-12-11 09:07:07 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2023-12-11 09:07:59 -0800
commit55621d1af55be7bf9a2c8e5dcef4368d9a6d4e51 (patch)
tree4c0e74b9a45b8875e35ee543089315a0d9989df1 /absl/strings/str_replace.cc
parentfad946221cec37175e762c399760f54b9de9a9fa (diff)
Add nullability annotations
PiperOrigin-RevId: 589842893 Change-Id: I9657761d1f71c665582406f278c6605f6d382f6d
Diffstat (limited to 'absl/strings/str_replace.cc')
-rw-r--r--absl/strings/str_replace.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/absl/strings/str_replace.cc b/absl/strings/str_replace.cc
index 9ce49e56..a7ab52fe 100644
--- a/absl/strings/str_replace.cc
+++ b/absl/strings/str_replace.cc
@@ -21,6 +21,7 @@
#include <vector>
#include "absl/base/config.h"
+#include "absl/base/nullability.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@@ -36,8 +37,8 @@ using FixedMapping =
// occurred.
int ApplySubstitutions(
absl::string_view s,
- std::vector<strings_internal::ViableSubstitution>* subs_ptr,
- std::string* result_ptr) {
+ absl::Nonnull<std::vector<strings_internal::ViableSubstitution>*> subs_ptr,
+ absl::Nonnull<std::string*> result_ptr) {
auto& subs = *subs_ptr;
int substitutions = 0;
size_t pos = 0;
@@ -82,7 +83,7 @@ std::string StrReplaceAll(absl::string_view s,
}
int StrReplaceAll(strings_internal::FixedMapping replacements,
- std::string* target) {
+ absl::Nonnull<std::string*> target) {
return StrReplaceAll<strings_internal::FixedMapping>(replacements, target);
}