the_type/
lib.rs

1#![no_std]
2//! A crate providing function which helps specifying type within the expression.
3
4/// Specify the type [`T`] of expression [`expr`]
5/// # Example
6/// ```
7/// # use the_type::the;
8/// let foo: u8 = 0;
9/// let items1 : [usize; 4] = [foo.into(); 4];
10///
11/// // won't compile becuase Into is a generic trait but self.into() is not a generic method
12/// // let items2 = [foo.into::<usize>(): usize ; 4];
13/// // an alternative way: 
14/// let items3 = [usize::from(foo); 4];
15/// // a more intuitive way:
16/// let items4 = [the::<usize>(foo.into()); 4];
17/// ```
18pub fn the<T>(expr: T) -> T {
19    expr
20}