mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 21:25:00 +01:00
Require braces on conditions and loops. (#218)
The rationale and rule for this was added in #194 to the C++ style guide we are using for Carbon. I've applied the automated fixes from running `clang-tidy` over all the code, and then run `clang-format` afterward. There are a few places where `clang-format` fixed a formatting issue that snuck through in prior commits. These were rare enough that it didn't seem worth splitting them out into a separate change.
This commit is contained in:
@@ -376,10 +376,11 @@ auto GetAndDropLine(llvm::StringRef& s) -> std::string {
|
||||
auto newline_offset = s.find_first_of('\n');
|
||||
llvm::StringRef line = s.slice(0, newline_offset);
|
||||
|
||||
if (newline_offset != llvm::StringRef::npos)
|
||||
if (newline_offset != llvm::StringRef::npos) {
|
||||
s = s.substr(newline_offset + 1);
|
||||
else
|
||||
} else {
|
||||
s = "";
|
||||
}
|
||||
|
||||
return line.str();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user