How do I implement a trait for an array with fixed size say
[String;1], [String:2], [String: 3] .. [String;n]
I can workaround with the compiler by doing
impl ToColumnName for [String;1]{
...
}
impl ToColumnName for [String;2]{
...
}
impl ToColumnName for [String;3]{
...
}
macro_rules! impl_to_column_name_for_string{
($x:expr)=>(
impl ToColumnName for [String;$x]{
...
}
);
}
impl_to_column_name_for_string!(4);
impl_to_column_name_for_string!(5);
impl_to_column_name_for_string!(6);
impl_to_column_name_for_string!(7);
impl_to_column_name_for_string!(8);
impl_to_column_name_for_string!(9);
impl_to_column_name_for_string!(10);
impl_to_column_name_for_string!(11);
impl_to_column_name_for_string!(12);
but I think this is code bloat, and it doesn't even handle arrays with more than 12 items