Fix clang-tidy warning after upgrading to clang-tidy-15

This commit is contained in:
Bartek Kryza
2023-03-02 00:33:28 +01:00
parent 884e021b9a
commit 464d80eca3
25 changed files with 114 additions and 78 deletions

View File

@@ -212,8 +212,9 @@ inja::json generator<C, D>::element_context(const E &e) const
ctx["element"]["source"]["line"] = e.line();
}
if (e.comment().has_value()) {
ctx["element"]["comment"] = e.comment().value();
const auto maybe_comment = e.comment();
if (maybe_comment) {
ctx["element"]["comment"] = maybe_comment.value();
}
return ctx;