srctree

Robin Linden parent caf0fae5 cee0c63f
meta/clang-tidy: Enable bugprone-optional-value-conversion

inlinesplit
.clang-tidy added: 8, removed: 10, total 0
@@ -29,7 +29,6 @@
# haven't been doing so far.
#
# TODO(robinlinden): Look into and enable:
# * bugprone-optional-value-conversion
# * clang-analyzer-optin.core.EnumCastOutOfRange
# * performance-enum-size
Checks: >
@@ -65,7 +64,6 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-narrowing-conversions,
-bugprone-optional-value-conversion,
-bugprone-unchecked-optional-access,
-cert-dcl21-cpp,
-clang-analyzer-optin.core.EnumCastOutOfRange,
 
css/parser.cpp added: 8, removed: 10, total 0
@@ -211,12 +211,12 @@ std::optional<std::string> try_parse_font_style(Tokenizer &tokenizer) {
std::optional<std::string_view> try_parse_font_weight(Tokenizer &tokenizer) {
if (auto maybe_font_weight = tokenizer.get()) {
if (is_weight(*maybe_font_weight)) {
return *maybe_font_weight;
return maybe_font_weight;
}
 
if (auto maybe_int = to_int(*maybe_font_weight)) {
if (*maybe_int >= 1 && *maybe_int <= 1000) {
return *maybe_font_weight;
return maybe_font_weight;
}
}
}
@@ -226,7 +226,7 @@ std::optional<std::string_view> try_parse_font_weight(Tokenizer &tokenizer) {
std::optional<std::string_view> try_parse_font_variant(Tokenizer &tokenizer) {
if (auto maybe_font_variant = tokenizer.get()) {
if (*maybe_font_variant == "small-caps") {
return *maybe_font_variant;
return maybe_font_variant;
}
}
return std::nullopt;
@@ -235,7 +235,7 @@ std::optional<std::string_view> try_parse_font_variant(Tokenizer &tokenizer) {
std::optional<std::string_view> try_parse_font_stretch(Tokenizer &tokenizer) {
if (auto maybe_font_stretch = tokenizer.get()) {
if (is_stretch(*maybe_font_stretch)) {
return *maybe_font_stretch;
return maybe_font_stretch;
}
}
return std::nullopt;
 
layout/layout.cpp added: 8, removed: 10, total 0
@@ -486,7 +486,7 @@ std::optional<LayoutBox> create_layout(style::StyledNode const &node, int width,
collapse_whitespace(*tree);
 
Layouter{node.get_property<css::PropertyId::FontSize>(), type}.layout(*tree, {0, 0, width, 0});
return *tree;
return tree;
}
 
} // namespace layout