diff options
author | Dino Radakovic <dinor@google.com> | 2024-05-23 16:00:58 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-23 16:01:51 -0700 |
commit | 8bb0b50320274e4d8e0b63d26eafe1871f5241c0 (patch) | |
tree | 3333ba7173eb9102b43de6cdbd889a2aed597a72 /absl/functional | |
parent | d60c089e06b638483db5995d16550303225b1b5b (diff) | |
download | abseil-8bb0b50320274e4d8e0b63d26eafe1871f5241c0.tar.gz abseil-8bb0b50320274e4d8e0b63d26eafe1871f5241c0.tar.bz2 abseil-8bb0b50320274e4d8e0b63d26eafe1871f5241c0.zip |
`overload_test`: Remove a few unnecessary trailing return types
`absl::StrCat` always returns a `std::string`. Specifying it using a trailing return type does not help.
Tests are documentation, and they should be consistent with [the google style guide](https://google.github.io/styleguide/cppguide.html#trailing_return).
For example, this is different than `-> absl::string_view` and returning string literals, where it is actually a load-bearing change.
PiperOrigin-RevId: 636705683
Change-Id: I0d84a562a59bc0c16be01dd2ae5538adb401432e
Diffstat (limited to 'absl/functional')
-rw-r--r-- | absl/functional/overload_test.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/absl/functional/overload_test.cc b/absl/functional/overload_test.cc index a2e87674..92f0eb9b 100644 --- a/absl/functional/overload_test.cc +++ b/absl/functional/overload_test.cc @@ -32,12 +32,10 @@ namespace { TEST(OverloadTest, DispatchConsidersTypeWithAutoFallback) { auto overloaded = absl::Overload{ - [](int v) -> std::string { return absl::StrCat("int ", v); }, - [](double v) -> std::string { return absl::StrCat("double ", v); }, - [](const char* v) -> std::string { - return absl::StrCat("const char* ", v); - }, - [](auto v) -> std::string { return absl::StrCat("auto ", v); }, + [](int v) { return absl::StrCat("int ", v); }, + [](double v) { return absl::StrCat("double ", v); }, + [](const char* v) { return absl::StrCat("const char* ", v); }, + [](auto v) { return absl::StrCat("auto ", v); }, }; EXPECT_EQ("int 1", overloaded(1)); |