Closed biryukovmaxim closed 4 days ago
@Peternator7 could you check it out?
Seems reasonable to me, could you add a test case?
Seems reasonable to me, could you add a test case?
Added
Could someone on the team merge this?
@Peternator7 could you take a look?
This pull request introduces the
const_into_str
attribute to thestrum
macros, enabling enums to be converted into static strings in const contexts. This feature is particularly useful when working with compile-time string manipulations, such as those required byconcatcp
.Key Changes:
const_into_str
keyword in enum metadata processing.const fn into_str()
method for enums marked withconst_into_str
.From
trait to utilizeinto_str()
whenconst_into_str
is enabled.The implementation ensures that existing functionality is preserved and provides users with the option to opt into this new feature as needed. This feature could be especially beneficial for users needing efficient, compile-time safe string operations involving enums.
Please review the changes and let me know if there are any modifications or improvements required.
resolves #352