[clang-tools-extra] [clang-doc][nfc] Avoid constructing SmallString in ToString method (PR #96921)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 08:15:21 PDT 2024


ilovepi wrote:

> I'd use `std::string_view` as a return value instead of `const char *` as a more idiomatic C++ in which case you don't need to rename the method to `c_str()`.

I opted for `StringRef`, since that seems more in line w/ the conventions here, but I'm happy to switch to `std::string_view` if you'd prefer.

https://github.com/llvm/llvm-project/pull/96921


More information about the cfe-commits mailing list