You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Certain types such as the Ratio type which is used for dimensions if rational dimensions are enabled and in the near future the type containing magnitudes (a const float type of thing) are needed by both diman_unit_system (to compute dimensions while parsing the macro) and by the calling crate (for the const generics).
Now, there is no way to export them from diman_unit_system because it's a proc_macro crate and not allowed to export any non-proc_macros. They also can't be exported from diman because that would introduce a cyclic dependency.
I think adding a diman_lib that contains this shared functionality is useful.
It solves the problem with duplicate code.
Less code generated by the macro probably means slightly better compile behavior when the user uses their own custom unit_system and changes something in it.
It doesnt require writing the code in the macro itself which is always a bit more bug-prone and just unfun in general.
The text was updated successfully, but these errors were encountered:
Certain types such as the
Ratio
type which is used for dimensions if rational dimensions are enabled and in the near future the type containing magnitudes (a const float type of thing) are needed by bothdiman_unit_system
(to compute dimensions while parsing the macro) and by the calling crate (for the const generics).Now, there is no way to export them from
diman_unit_system
because it's a proc_macro crate and not allowed to export any non-proc_macros. They also can't be exported fromdiman
because that would introduce a cyclic dependency.I think adding a
diman_lib
that contains this shared functionality is useful.unit_system
and changes something in it.The text was updated successfully, but these errors were encountered: