INNER CODE UNIT · Rust

get_weight

jhspetersson/fselect · src/field/mod.rs:147

            pub fn get_weight(&self) -> i32 {
                match self {
                    $(
                        $(#[$variant_attrs])*
                        $enum_name::$variant => {
                            stringify!($($weight)?) .parse().unwrap_or(0)
                        }
                    )*
                }
            }

            pub fn get_names_and_descriptions() -> Vec<(Vec<&'static str>, &'static str)> {
                vec![
                    $(
                        $(#[$variant_attrs])*
                        (vec![$($text,)*], $($description)?),
                    )*
                ]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…