oppiliappan / cutlass

experimental auto-currying for rust functions
https://crates.io/crates/cutlass
MIT License
32 stars 3 forks source link

Change type names to prevent compiler warnings #1

Closed vbrandl closed 4 years ago

vbrandl commented 4 years ago

In the current state, state names are formatted as _<fn name>_T<n>.

This results in compiler warnings when using the macro:

warning: type `_add_T0` should have an upper camel case name                                                                                                              
 --> src/main.rs:4:4                                                                                                                                                      
  |                                                                                                                                                                       
4 | fn add(x: i32, y: i32) -> i32 {                                                                                                                                       
  |    ^^^ help: convert the identifier to upper camel case: `AddT0`                                                                                                      
  |                                                                                                                                                                       
  = note: `#[warn(non_camel_case_types)]` on by default

This change will name the types _T<n><fn name>. This way the name always starts with an uppercase letter and the warning disappears.

oppiliappan commented 4 years ago

Beautiful!

Thank you for your contribution!