Update rustfmt to the 2024 style edition (#35764)

* Use 2024 style edition

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reformat all code

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-03-03 12:26:53 +01:00 committed by GitHub
parent 6300e820b4
commit 3d320fa96a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
603 changed files with 1739 additions and 1648 deletions

View file

@ -3,8 +3,8 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use style::color::{AbsoluteColor, ColorSpace};
use style::properties::style_structs::Font;
use style::properties::ComputedValues;
use style::properties::style_structs::Font;
use style::values::animated::{Animate, Context, Procedure, ToAnimatedValue};
fn interpolate_color(from: AbsoluteColor, to: AbsoluteColor, progress: f64) -> AbsoluteColor {

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use app_units::Au;
use style::attr::{parse_length, AttrValue, LengthOrPercentageOrAuto};
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_length};
#[test]
fn test_parse_double() {

View file

@ -19,9 +19,9 @@ use style::queries::values::PrefersColorScheme;
use style::rule_cache::RuleCacheConditions;
use style::rule_tree::CascadeLevel;
use style::servo::media_queries::FontMetricsProvider;
use style::stylesheets::UrlExtraData;
use style::stylesheets::container_rule::ContainerSizeQuery;
use style::stylesheets::layer_rule::LayerOrder;
use style::stylesheets::UrlExtraData;
use style::stylist::Stylist;
use style::values::computed::font::GenericFontFamily;
use style::values::computed::{Context, Length};

View file

@ -110,8 +110,7 @@ fn background_shorthand_should_parse_when_some_fields_set() {
#[test]
fn background_shorthand_should_parse_comma_separated_declarations() {
let input =
"url(\"http://servo/test.png\") top left no-repeat, url(\"http://servo/test.png\") \
let input = "url(\"http://servo/test.png\") top left no-repeat, url(\"http://servo/test.png\") \
center / 100% 100% no-repeat, white";
let result = parse(background::parse_value, input).unwrap();

View file

@ -3,12 +3,12 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use style::parser::Parse;
use style::properties::MaybeBoxed;
use style::properties::longhands::{
border_image_outset, border_image_repeat, border_image_slice, border_image_source,
border_image_width,
};
use style::properties::shorthands::border_image;
use style::properties::MaybeBoxed;
use style::values::specified::BorderRadius;
use style_traits::ToCss;

View file

@ -9,8 +9,8 @@ use crate::parsing::parse;
#[test]
fn negative_letter_spacing_should_parse_properly() {
use style::properties::longhands::letter_spacing;
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
use style::values::specified::LetterSpacing;
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
let negative_value = parse_longhand!(letter_spacing, "-0.5em");
let expected = LetterSpacing(Spacing::Value(LengthPercentage::Length(
@ -22,8 +22,8 @@ fn negative_letter_spacing_should_parse_properly() {
#[test]
fn negative_word_spacing_should_parse_properly() {
use style::properties::longhands::word_spacing;
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
use style::values::specified::WordSpacing;
use style::values::specified::length::{FontRelativeLength, LengthPercentage, NoCalcLength};
let negative_value = parse_longhand!(word_spacing, "-0.5em");
let expected = WordSpacing(Spacing::Value(LengthPercentage::Length(

View file

@ -23,21 +23,27 @@ fn test_cubic_bezier() {
);
// p1x and p2x values must be in range [0, 1]
assert!(parse(
transition_timing_function::parse,
"cubic-bezier(-1, 0, 0, 0"
)
.is_err());
assert!(parse(
transition_timing_function::parse,
"cubic-bezier(0, 0, -1, 0"
)
.is_err());
assert!(parse(
transition_timing_function::parse,
"cubic-bezier(-1, 0, -1, 0"
)
.is_err());
assert!(
parse(
transition_timing_function::parse,
"cubic-bezier(-1, 0, 0, 0"
)
.is_err()
);
assert!(
parse(
transition_timing_function::parse,
"cubic-bezier(0, 0, -1, 0"
)
.is_err()
);
assert!(
parse(
transition_timing_function::parse,
"cubic-bezier(-1, 0, -1, 0"
)
.is_err()
);
assert!(parse(transition_timing_function::parse, "cubic-bezier(2, 0, 0, 0").is_err());
assert!(parse(transition_timing_function::parse, "cubic-bezier(0, 0, 2, 0").is_err());

View file

@ -9,7 +9,7 @@ use style::applicable_declarations::CascadePriority;
use style::context::QuirksMode;
use style::error_reporting::{ContextualParseError, ParseErrorReporter};
use style::media_queries::MediaList;
use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDeclarationBlock};
use style::properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, longhands};
use style::rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
use style::shared_lock::{SharedRwLock, StylesheetGuards};
use style::stylesheets::layer_rule::LayerOrder;

View file

@ -12,7 +12,7 @@ use style::font_metrics::FontMetrics;
use style::media_queries::{Device, MediaType};
use style::properties::style_structs::Font;
use style::properties::{
longhands, ComputedValues, Importance, PropertyDeclaration, PropertyDeclarationBlock,
ComputedValues, Importance, PropertyDeclaration, PropertyDeclarationBlock, longhands,
};
use style::queries::values::PrefersColorScheme;
use style::rule_tree::StyleSource;
@ -22,11 +22,11 @@ use style::servo::media_queries::FontMetricsProvider;
use style::shared_lock::SharedRwLock;
use style::stylesheets::StyleRule;
use style::stylist::{
needs_revalidation_for_testing, ContainerConditionId, LayerId, Rule, ScopeConditionId, Stylist,
ContainerConditionId, LayerId, Rule, ScopeConditionId, Stylist, needs_revalidation_for_testing,
};
use style::thread_state::{self, ThreadState};
use style::values::computed::font::GenericFontFamily;
use style::values::computed::Length;
use style::values::computed::font::GenericFontFamily;
use url::Url;
#[derive(Debug)]
@ -242,10 +242,12 @@ fn test_insert() {
.unwrap()[0]
.source_order
);
assert!(selector_map
.class_hash
.get(&Atom::from("intro"), QuirksMode::NoQuirks)
.is_none());
assert!(
selector_map
.class_hash
.get(&Atom::from("intro"), QuirksMode::NoQuirks)
.is_none()
);
}
fn mock_stylist() -> Stylist {