Crate turbonone[][src]

crates.io docs.rs license

Tiny macro for calling functions with generic Option<T> arguments.

Usage

Add to your Cargo.toml file:

[dependencies]
turbonone = "0.*"

The Problem

fn my_function<T>(arg: Option<T>) -> &'static str {
    "Works!"
}
 
my_function(None); // cannot infer type for type parameter `T` declared on the associated function `my_function`
my_function(Some("An argument")); // Works!

The Solution

use turbonone::turbonone;
 
fn my_function<T>(arg: Option<T>) -> &'static str {
    "Works!"
}
 
my_function(turbonone!()); // Works!
my_function(Some("An argument")); // Works!

Macros

turbonone