Crates.io | underscore_args |
lib.rs | underscore_args |
version | 0.1.2 |
source | src |
created_at | 2018-12-11 11:52:01.477408 |
updated_at | 2018-12-13 19:35:47.49784 |
description | Macro for underscore named argument syntax, aka Dyon |
homepage | https://github.com/PistonDevelopers/underscore_args |
repository | https://github.com/PistonDevelopers/underscore_args.git |
max_upload_size | |
id | 101425 |
size | 5,263 |
Macro for underscore named argumet syntax, aka Dyon.
This library requires Rust 2018 nightly and only works for functions, not methods.
By naming a function line__color_from_to
, one can call it like this:
args!(line(color: [1.0; 4], from: [0.0, 0.0], to: [100.0, 100.0]))
#![feature(concat_idents)]
use underscore_args::args;
#[allow(non_snake_case)]
fn line__color_from_to(_color: [f32; 4], _from: [f32; 2], _to: [f32; 2]) {}
args!(line(color: [1.0; 4], from: [0.0, 0.0], to: [100.0, 100.0]));