add apply
| -rw-r--r-- | Cargo.lock | 6 | ||||
| -rw-r--r-- | Cargo.toml | 4 | ||||
| -rw-r--r-- | src/lib.rs | 13 |
3 files changed, 17 insertions, 6 deletions
@@ -4,16 +4,16 @@ version = 3 [[package]] name = "lower" -version = "0.1.4" +version = "0.2.0" dependencies = [ "lower-macros", ] [[package]] name = "lower-macros" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "383823c24b2a094a6a9de418eba3b60bf8186b688e74e4a20ba5321dfae04fba" +checksum = "f0b43ed50f1f56bf1dedc1c8977b61394c9a970db3707c8b8b8ff81ac1b46d83" dependencies = [ "proc-macro2", "quote", @@ -1,6 +1,6 @@ [package] name = "lower" -version = "0.1.4" +version = "0.2.0" authors = ["bend-n <[email protected]>"] description = "desugar math where the compiler wont" edition = "2021" @@ -10,4 +10,4 @@ keywrords = ["fast", "math", "float"] categories = ["hardware-support", "mathematics"] [dependencies] -lower-macros = "0.1.1" +lower-macros = "0.2" @@ -23,6 +23,18 @@ pub mod fast { pub use lower_macros::fast as math; } +/// Applys the macro to your stmts. +/// Argument can be `algebraic` | `fast` | `basic` | none +/// ``` +/// # #![feature(core_intrinsics)] +/// #[lower::apply(algebraic)] +/// fn madd(a: f32, b: f32, c: f32) -> f32 { +/// a * b + c +/// } +/// ``` +/// Enaables nicer formatting and better rust analyzer integration. +pub use lower_macros::apply; + /// Lower math to method calls. Only useful if you define the functions. /// ``` /// # use std::ops::*; @@ -31,5 +43,4 @@ pub mod fast { /// // expands to /// // a.mul((&b).deref()).add(c.neg()) /// ``` -/// <p style="display: none"> pub use lower_macros::math; |