diff --git a/src/libexpr/print-options.hh b/src/libexpr/print-options.hh index 94767df9c..6c5e80c61 100644 --- a/src/libexpr/print-options.hh +++ b/src/libexpr/print-options.hh @@ -71,7 +71,7 @@ struct PrintOptions /** * True if pretty-printing is enabled. */ - inline bool prettyPrint() + inline bool shouldPrettyPrint() { return prettyIndent > 0; } diff --git a/src/libexpr/print.cc b/src/libexpr/print.cc index 76f9a9c56..572db25ed 100644 --- a/src/libexpr/print.cc +++ b/src/libexpr/print.cc @@ -166,14 +166,14 @@ private: void increaseIndent() { - if (options.prettyPrint()) { + if (options.shouldPrettyPrint()) { indent.append(options.prettyIndent, ' '); } } void decreaseIndent() { - if (options.prettyPrint()) { + if (options.shouldPrettyPrint()) { assert(indent.size() >= options.prettyIndent); indent.resize(indent.size() - options.prettyIndent); } @@ -277,7 +277,7 @@ private: bool shouldPrettyPrintAttrs(AttrVec & v) { - if (!options.prettyPrint() || v.empty()) { + if (!options.shouldPrettyPrint() || v.empty()) { return false; } @@ -354,7 +354,7 @@ private: bool shouldPrettyPrintList(std::span list) { - if (!options.prettyPrint() || list.empty()) { + if (!options.shouldPrettyPrint() || list.empty()) { return false; }