Skip to content

Commit bb718d1

Browse files
authored
migrate to maintained library (#1035)
1 parent a2faf99 commit bb718d1

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ lazy_static = "1.4.0"
7272
const-str = "0.3.1"
7373
pathdiff = "0.2.1"
7474
ahash = "0.8.7"
75-
paste = "1.0.12"
75+
pastey = "0.1.0"
7676
indexmap = { version = "2.2.6", features = ["serde"] }
7777
# CLI deps
7878
atty = { version = "0.2", optional = true }

src/macros.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ macro_rules! shorthand_property_bitflags {
189189
crate::macros::shorthand_property_bitflags!($name, [$($all),*] $($rest),* ; $last_index + 1; $($var = $index)* $cur = $last_index + 1);
190190
};
191191
($name:ident, [$($all:ident),*] $cur:ident; $last_index:expr ; $($var:ident = $index:expr)+) => {
192-
paste::paste! {
192+
pastey::paste! {
193193
crate::macros::property_bitflags! {
194194
#[derive(Default, Debug)]
195195
struct [<$name Property>]: u8 {
@@ -216,7 +216,7 @@ macro_rules! shorthand_handler {
216216
$(
217217
pub $key: Option<$type>,
218218
)*
219-
flushed_properties: paste::paste!([<$shorthand Property>]),
219+
flushed_properties: pastey::paste!([<$shorthand Property>]),
220220
has_any: bool
221221
}
222222

@@ -250,7 +250,7 @@ macro_rules! shorthand_handler {
250250

251251
let mut unparsed = val.clone();
252252
context.add_unparsed_fallbacks(&mut unparsed);
253-
paste::paste! {
253+
pastey::paste! {
254254
self.flushed_properties.insert([<$shorthand Property>]::try_from(&unparsed.property_id).unwrap());
255255
};
256256
dest.push(Property::Unparsed(unparsed));
@@ -263,7 +263,7 @@ macro_rules! shorthand_handler {
263263

264264
fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut PropertyHandlerContext<'i, '_>) {
265265
self.flush(dest, context);
266-
self.flushed_properties = paste::paste!([<$shorthand Property>]::empty());
266+
self.flushed_properties = pastey::paste!([<$shorthand Property>]::empty());
267267
}
268268
}
269269

@@ -289,7 +289,7 @@ macro_rules! shorthand_handler {
289289
};
290290

291291
$(
292-
if $shorthand_fallback && !self.flushed_properties.intersects(paste::paste!([<$shorthand Property>]::$shorthand)) {
292+
if $shorthand_fallback && !self.flushed_properties.intersects(pastey::paste!([<$shorthand Property>]::$shorthand)) {
293293
let fallbacks = shorthand.get_fallbacks(context.targets);
294294
for fallback in fallbacks {
295295
dest.push(Property::$shorthand(fallback));
@@ -298,15 +298,15 @@ macro_rules! shorthand_handler {
298298
)?
299299

300300
dest.push(Property::$shorthand(shorthand));
301-
paste::paste! {
301+
pastey::paste! {
302302
self.flushed_properties.insert([<$shorthand Property>]::$shorthand);
303303
};
304304
} else {
305305
$(
306306
#[allow(unused_mut)]
307307
if let Some(mut val) = $key {
308308
$(
309-
if $fallback && !self.flushed_properties.intersects(paste::paste!([<$shorthand Property>]::$prop)) {
309+
if $fallback && !self.flushed_properties.intersects(pastey::paste!([<$shorthand Property>]::$prop)) {
310310
let fallbacks = val.get_fallbacks(context.targets);
311311
for fallback in fallbacks {
312312
dest.push(Property::$prop(fallback));
@@ -315,7 +315,7 @@ macro_rules! shorthand_handler {
315315
)?
316316

317317
dest.push(Property::$prop(val));
318-
paste::paste! {
318+
pastey::paste! {
319319
self.flushed_properties.insert([<$shorthand Property>]::$prop);
320320
};
321321
}
@@ -390,7 +390,7 @@ macro_rules! impl_shorthand {
390390
impl<'i> Shorthand<'i> for $t {
391391
#[allow(unused_variables)]
392392
fn from_longhands(decls: &DeclarationBlock<'i>, vendor_prefix: crate::vendor_prefix::VendorPrefix) -> Option<(Self, bool)> {
393-
use paste::paste;
393+
use pastey::paste;
394394

395395
$(
396396
$(

src/properties/list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ macro_rules! counter_styles {
108108
fn is_compatible(&self, browsers: Browsers) -> bool {
109109
match self {
110110
$(
111-
PredefinedCounterStyle::$id => paste::paste! {
111+
PredefinedCounterStyle::$id => pastey::paste! {
112112
crate::compat::Feature::[<$id ListStyleType>].is_compatible(browsers)
113113
},
114114
)+

src/properties/prefix_handler.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ macro_rules! define_fallbacks {
7979
(
8080
$( $name: ident$(($p: ident))?, )+
8181
) => {
82-
paste::paste! {
82+
pastey::paste! {
8383
#[derive(Default)]
8484
pub(crate) struct FallbackHandler {
8585
$(
@@ -97,7 +97,7 @@ macro_rules! define_fallbacks {
9797
$(
9898
$p = context.targets.prefixes($p, Feature::$name);
9999
)?
100-
if paste::paste! { self.[<$name:snake>] }.is_none() {
100+
if pastey::paste! { self.[<$name:snake>] }.is_none() {
101101
let fallbacks = val.get_fallbacks(context.targets);
102102
#[allow(unused_variables)]
103103
let has_fallbacks = !fallbacks.is_empty();
@@ -112,10 +112,10 @@ macro_rules! define_fallbacks {
112112
)?
113113
}
114114

115-
if paste::paste! { self.[<$name:snake>] }.is_none() || matches!(context.targets.browsers, Some(targets) if !val.is_compatible(targets)) {
116-
paste::paste! { self.[<$name:snake>] = Some(dest.len()) };
115+
if pastey::paste! { self.[<$name:snake>] }.is_none() || matches!(context.targets.browsers, Some(targets) if !val.is_compatible(targets)) {
116+
pastey::paste! { self.[<$name:snake>] = Some(dest.len()) };
117117
dest.push(Property::$name(val $(, $p)?));
118-
} else if let Some(index) = paste::paste! { self.[<$name:snake>] } {
118+
} else if let Some(index) = pastey::paste! { self.[<$name:snake>] } {
119119
dest[index] = Property::$name(val $(, $p)?);
120120
}
121121
}
@@ -138,7 +138,7 @@ macro_rules! define_fallbacks {
138138
}
139139

140140
let val = get_prefixed!($($p)?);
141-
(val, paste::paste! { &mut self.[<$name:snake>] })
141+
(val, pastey::paste! { &mut self.[<$name:snake>] })
142142
}
143143
)+
144144
_ => return false
@@ -161,7 +161,7 @@ macro_rules! define_fallbacks {
161161

162162
fn finalize(&mut self, _: &mut DeclarationList, _: &mut PropertyHandlerContext) {
163163
$(
164-
paste::paste! { self.[<$name:snake>] = None };
164+
pastey::paste! { self.[<$name:snake>] = None };
165165
)+
166166
}
167167
}

0 commit comments

Comments
 (0)