mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
Everywhere: Remove sv
suffix from format string literals
This prevents the compile-time checks that would catch errors in the format invocation (which would usually lead to a runtime crash).
This commit is contained in:
parent
917537b449
commit
f070264800
Notes:
github-actions[bot]
2025-04-09 00:01:12 +00:00
Author: https://github.com/trflynn89
Commit: f070264800
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4286
28 changed files with 51 additions and 51 deletions
|
@ -178,11 +178,11 @@ void serialize_a_srgb_value(StringBuilder& builder, Color color)
|
|||
// (depending on whether the alpha is exactly 1, or not), with lowercase letters for the function name.
|
||||
// NOTE: Since we use Gfx::Color, having an "alpha of 1" means its value is 255.
|
||||
if (color.alpha() == 0)
|
||||
builder.appendff("rgba({}, {}, {}, 0)"sv, color.red(), color.green(), color.blue());
|
||||
builder.appendff("rgba({}, {}, {}, 0)", color.red(), color.green(), color.blue());
|
||||
else if (color.alpha() == 255)
|
||||
builder.appendff("rgb({}, {}, {})"sv, color.red(), color.green(), color.blue());
|
||||
builder.appendff("rgb({}, {}, {})", color.red(), color.green(), color.blue());
|
||||
else
|
||||
builder.appendff("rgba({}, {}, {}, 0.{})"sv, color.red(), color.green(), color.blue(), format_to_8bit_compatible(color.alpha()).data());
|
||||
builder.appendff("rgba({}, {}, {}, 0.{})", color.red(), color.green(), color.blue(), format_to_8bit_compatible(color.alpha()).data());
|
||||
}
|
||||
|
||||
String serialize_an_identifier(StringView ident)
|
||||
|
|
|
@ -29,7 +29,7 @@ String ConicGradientStyleValue::to_string(SerializationMode mode) const
|
|||
if (has_at_position) {
|
||||
if (has_from_angle)
|
||||
builder.append(' ');
|
||||
builder.appendff("at {}"sv, m_properties.position->to_string(mode));
|
||||
builder.appendff("at {}", m_properties.position->to_string(mode));
|
||||
}
|
||||
if (has_color_space) {
|
||||
if (has_from_angle || has_at_position)
|
||||
|
|
|
@ -52,10 +52,10 @@ String FilterValueListStyleValue::to_string(SerializationMode) const
|
|||
builder.append(' ');
|
||||
filter_function.visit(
|
||||
[&](FilterOperation::Blur const& blur) {
|
||||
builder.appendff("blur({}"sv, blur.radius.to_string());
|
||||
builder.appendff("blur({}", blur.radius.to_string());
|
||||
},
|
||||
[&](FilterOperation::DropShadow const& drop_shadow) {
|
||||
builder.appendff("drop-shadow("sv);
|
||||
builder.append("drop-shadow("sv);
|
||||
if (drop_shadow.color.has_value()) {
|
||||
serialize_a_srgb_value(builder, *drop_shadow.color);
|
||||
builder.append(' ');
|
||||
|
|
|
@ -51,7 +51,7 @@ String LinearGradientStyleValue::to_string(SerializationMode mode) const
|
|||
if (has_direction) {
|
||||
m_properties.direction.visit(
|
||||
[&](SideOrCorner side_or_corner) {
|
||||
builder.appendff("{}{}"sv, m_properties.gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_string(side_or_corner));
|
||||
builder.appendff("{}{}", m_properties.gradient_type == GradientType::Standard ? "to "sv : ""sv, side_or_corner_to_string(side_or_corner));
|
||||
},
|
||||
[&](Angle const& angle) {
|
||||
builder.append(angle.to_string());
|
||||
|
|
|
@ -19,7 +19,7 @@ String RadialGradientStyleValue::to_string(SerializationMode mode) const
|
|||
StringBuilder builder;
|
||||
if (is_repeating())
|
||||
builder.append("repeating-"sv);
|
||||
builder.appendff("radial-gradient("sv);
|
||||
builder.append("radial-gradient("sv);
|
||||
|
||||
bool has_size = !m_properties.size.has<Extent>() || m_properties.size.get<Extent>() != Extent::FarthestCorner;
|
||||
bool has_position = !m_properties.position->is_center();
|
||||
|
@ -54,7 +54,7 @@ String RadialGradientStyleValue::to_string(SerializationMode mode) const
|
|||
if (has_size)
|
||||
builder.append(' ');
|
||||
|
||||
builder.appendff("at {}"sv, m_properties.position->to_string(mode));
|
||||
builder.appendff("at {}", m_properties.position->to_string(mode));
|
||||
}
|
||||
|
||||
if (has_color_space) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue