Closed stevenengler closed 7 months ago
Wish we had impl types on const
.
I can see the value to this. I'm trying to keep the API small to keep the compatibility guarantees low and to keep the focus on the primary purpose, being used in public APIs. Being used for styling is a secondary benefit which I use but I also try to avoid optimizing for.
Will need to think about this more.
Okay, probably not worth changing now, but maybe worth considering if in the future you need to make API changes for some other reason.
After discussions in #166, I'm moving forward with #165 which I believe negates the need for this issue. I'm going ahead and closing it. Let us know if there is a reason to keep it open!
This is a very low priority feature request. I think it would be nice if
anstyle::Style::render
wereconst
since most otherStyle
methods areconst
, and it makes it a little nicer if you want to put the style in a module-level constant and not need to callrender()
everywhere that it's used.Example:
The problem is that
render()
returnsimpl Display + Copy + Clone
which is not nameable and cannot be placed in a constant, soStyleDisplay
would need to be made public and the signature ofrender()
would need to be changed.If you're open to this change, let me know and I can make a PR.