# generic-cast Imagine you want to provide an alternative implementation for a specific type-parameter of a generic function: ```rust use generic_cast::{cast_ref, equals}; use std::ops::Add; fn double>(a: T) -> T { if let Some(a) = cast_ref::(&a) { let result = a << 1; // Faster implementation *cast_ref::(&result).unwrap() } else { a.add(a).clone() } } ``` Or maybe just check if the type-paramter is a specific type: ```rust fn print(a: T) { if generic_cast::equals::() { println!("Its a float!"); } println!("{}", a); } ```