1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Style fixes

This commit is contained in:
Eelco Dolstra 2022-05-02 13:37:53 +02:00
parent 564faa6b4e
commit 61289ceee3
2 changed files with 7 additions and 8 deletions

View file

@ -2,7 +2,8 @@
#include <regex>
std::optional<std::string> parseListReferenceHeadRef(std::string_view line) {
std::optional<std::string> parseListReferenceHeadRef(std::string_view line)
{
const static std::regex head_ref_regex("^ref: ([^\\s]+)\\t+HEAD$");
std::match_results<std::string_view::const_iterator> match;
if (std::regex_match(line.cbegin(), line.cend(), match, head_ref_regex)) {
@ -12,7 +13,8 @@ std::optional<std::string> parseListReferenceHeadRef(std::string_view line) {
}
}
std::optional<std::string> parseListReferenceForRev(std::string_view rev, std::string_view line) {
std::optional<std::string> parseListReferenceForRev(std::string_view rev, std::string_view line)
{
const static std::regex rev_regex("^([^\\t]+)\\t+(.*)$");
std::match_results<std::string_view::const_iterator> match;
if (!std::regex_match(line.cbegin(), line.cend(), match, rev_regex)) {