mirror of
https://github.com/enso-org/enso.git
synced 2024-11-26 08:52:58 +03:00
Updating paste macro usage (#3334)
This commit is contained in:
parent
a87b2021a3
commit
ccaf24877f
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1300,7 +1300,6 @@ dependencies = [
|
||||
"nalgebra 0.26.2",
|
||||
"num-traits",
|
||||
"num_enum",
|
||||
"paste 1.0.6",
|
||||
"rustc-hash",
|
||||
"shrinkwraprs 0.3.0",
|
||||
"smallvec 1.8.0",
|
||||
|
@ -38,7 +38,6 @@ js-sys = { version = "0.3.28" }
|
||||
nalgebra = { version = "0.26.1" }
|
||||
num_enum = { version = "0.5.1" }
|
||||
num-traits = { version = "0.2" }
|
||||
paste = { version = "1.0.5" }
|
||||
rustc-hash = { version = "1.0.1" }
|
||||
shrinkwraprs = { version = "0.3.0" }
|
||||
smallvec = { version = "1.0.0" }
|
||||
|
@ -32,7 +32,7 @@ pub trait CloneableFnEasing = 'static + Clone + Fn(f32) -> f32;
|
||||
|
||||
macro_rules! define_in_out_easing_fn {
|
||||
(fn $tname:ident $name:ident $lambda:expr) => {
|
||||
paste::item! {
|
||||
paste! {
|
||||
/// A $name-in function type.
|
||||
pub type [<$tname In>] = impl Clone + Fn(f32) -> f32;
|
||||
/// A $name-out function type.
|
||||
|
@ -73,7 +73,7 @@ macro_rules! closure {
|
||||
($($larg:ident : $larg_type:ty),*)
|
||||
-> $type:ident
|
||||
$body:tt
|
||||
) => { paste::item! {
|
||||
) => { paste! {
|
||||
#[cfg(not(feature = "no_unboxed_callbacks"))]
|
||||
/// Closure type.
|
||||
pub type $type<$($param),*> =
|
||||
|
@ -152,7 +152,7 @@ macro_rules! emit_if_integer {
|
||||
/// Emits the StatsData struct, and extends StatsWithTimeProvider with accessors to StatsData
|
||||
/// fields.
|
||||
macro_rules! gen_stats {
|
||||
($($field:ident : $field_type:ty),* $(,)?) => { paste::item! {
|
||||
($($field:ident : $field_type:ty),* $(,)?) => { paste! {
|
||||
|
||||
|
||||
// === StatsData ===
|
||||
|
@ -1,5 +1,5 @@
|
||||
//! The core vector rendering engine for EnsoGL, a blazing fast 2D drawing library. This crate
|
||||
//! contains the core utilities necessary for the rendering engine to run correctly. See thr docs
|
||||
//! contains the core utilities necessary for the rendering engine to run correctly. See the docs
|
||||
//! of the `ensogl` crate to learn more.
|
||||
|
||||
#![recursion_limit = "512"]
|
||||
|
@ -410,7 +410,7 @@ use enum_dispatch::*;
|
||||
pub struct BadVariant;
|
||||
|
||||
macro_rules! define_any_buffer {
|
||||
([] [$([$base:ident $param:ident])*]) => { paste::item! {
|
||||
([] [$([$base:ident $param:ident])*]) => { paste! {
|
||||
|
||||
/// An enum with a variant per possible buffer type (i32, f32, Vector<f32>,
|
||||
/// and many, many more). It provides a faster alternative to dyn trait one:
|
||||
|
@ -237,7 +237,7 @@ impl<T> WithContent for Uniform<T> {
|
||||
pub struct TypeMismatch;
|
||||
|
||||
macro_rules! define_any_prim_uniform {
|
||||
( [] [$([$t1:ident $t2:ident])*] ) => { paste::item! {
|
||||
( [] [$([$t1:ident $t2:ident])*] ) => { paste! {
|
||||
/// Existentially typed uniform value.
|
||||
#[allow(non_camel_case_types)]
|
||||
#[enum_dispatch(AnyPrimUniformOps)]
|
||||
@ -285,7 +285,7 @@ impl<Value: UniformUpload> AnyPrimUniformOps for UniformData<Value> {
|
||||
// =========================
|
||||
|
||||
macro_rules! define_any_texture_uniform {
|
||||
( [ $([$storage:ident $internal_format:ident $item_type:ident])* ] ) => { paste::item! {
|
||||
( [ $([$storage:ident $internal_format:ident $item_type:ident])* ] ) => { paste! {
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Clone,CloneRef,Debug)]
|
||||
pub enum AnyTextureUniform {
|
||||
|
@ -278,9 +278,9 @@ macro_rules! examples {
|
||||
($($name:ident),*) => {$(
|
||||
std::mem::forget(Example::new(
|
||||
stringify!($name),
|
||||
paste::expr!{[<$name _in>]()},
|
||||
paste::expr!{[<$name _out>]()},
|
||||
paste::expr!{[<$name _in_out>]()},
|
||||
paste!{[<$name _in>]()},
|
||||
paste!{[<$name _out>]()},
|
||||
paste!{[<$name _in_out>]()},
|
||||
));
|
||||
)*};
|
||||
}
|
||||
|
@ -402,13 +402,13 @@ macro_rules! define_global_processor {
|
||||
/// Global processor definition.
|
||||
#[derive(Copy, Clone, Debug, Default)]
|
||||
pub struct $name;
|
||||
paste::item! {
|
||||
paste! {
|
||||
#[allow(non_upper_case_globals)]
|
||||
static mut [<$name _STATIC_MUT>]: Option<$tp> = None;
|
||||
}
|
||||
impl GlobalProcessor for $name {
|
||||
type Processor = $tp;
|
||||
paste::item! {
|
||||
paste! {
|
||||
#[allow(unsafe_code)]
|
||||
fn get_mut() -> &'static mut Self::Processor {
|
||||
unsafe {
|
||||
|
@ -322,7 +322,7 @@ impl<T> HasLens for T {}
|
||||
|
||||
macro_rules! mk_lens_field_decl {
|
||||
($struct_name:ident<$($param:ident),*>{$field_name:ident : $field_type:ty}) => {
|
||||
paste::item! {
|
||||
paste! {
|
||||
// struct FIELD_bar;
|
||||
struct [<FIELD_ $field_name>];
|
||||
|
||||
@ -336,7 +336,7 @@ paste::item! {
|
||||
|
||||
macro_rules! mk_lenses_for {
|
||||
($struct_name:ident<$($param:ident),*>{$field_name:ident : $field_type:ty}) => {
|
||||
paste::item! {
|
||||
paste! {
|
||||
|
||||
mk_lens_field_decl!($struct_name<$($param),*>{$field_name:$field_type});
|
||||
|
||||
@ -423,7 +423,7 @@ paste::item! {
|
||||
}};
|
||||
|
||||
($struct_name:ident<$($param:ident),*> :: $cons_name:ident {$field_name:ident : $field_type:ty}) => {
|
||||
paste::item! {
|
||||
paste! {
|
||||
|
||||
mk_lens_field_decl!($struct_name<$($param),*>{$field_name:$field_type});
|
||||
|
||||
|
@ -37,7 +37,7 @@ itertools = "0.10.0"
|
||||
lazy_static = "1.4"
|
||||
num = "0.4.0"
|
||||
object = { version = "0.24.0" }
|
||||
paste = "1.0.5"
|
||||
paste = "1.0"
|
||||
shrinkwraprs = "0.3.0"
|
||||
serde = { version = "1.0.126", features = ["derive", "rc"], optional = true }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
|
@ -76,7 +76,7 @@ pub use ifmt::*;
|
||||
pub use itertools::Itertools;
|
||||
pub use lazy_static::lazy_static;
|
||||
pub use num::Num;
|
||||
pub use paste;
|
||||
pub use paste::paste;
|
||||
pub use shrinkwraprs::Shrinkwrap;
|
||||
pub use weak_table;
|
||||
pub use weak_table::traits::WeakElement;
|
||||
@ -190,7 +190,7 @@ where
|
||||
#[macro_export]
|
||||
macro_rules! clone_boxed {
|
||||
( $name:ident ) => {
|
||||
paste::item! {
|
||||
paste! {
|
||||
#[allow(missing_docs)]
|
||||
pub trait [<CloneBoxedFor $name>] {
|
||||
fn clone_boxed(&self) -> Box<dyn $name>;
|
||||
|
@ -210,7 +210,7 @@ macro_rules! shared_struct {
|
||||
}
|
||||
}
|
||||
|
||||
paste::item! {
|
||||
paste! {
|
||||
$(#[$($meta)*])*
|
||||
#[derive(CloneRef)]
|
||||
pub struct [<Weak $name>] <$($params)*> { weak: Weak<RefCell<$name_mut<$($params)*>>> }
|
||||
|
Loading…
Reference in New Issue
Block a user