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
Right now the paint function on Style and Color only accepts
I where
I:Into<Cow<'a,S>>,
<SasToOwned>::Owned:Debug,
But in the documents it notes that the paint function doesn't do allocations and return the string with the color applied, instead it returns a Display type which wraps the original string. It seems like this restriction could be relaxed without making a breaking change.
Ideally I'd like it to return a type that impls Display if the inner type impls display, and impls Debug if the inner type impls Debug, which would let me write code like this:
Right now the
paint
function onStyle
andColor
only acceptsBut in the documents it notes that the paint function doesn't do allocations and return the string with the color applied, instead it returns a
Display
type which wraps the original string. It seems like this restriction could be relaxed without making a breaking change.Ideally I'd like it to return a type that impls Display if the inner type impls display, and impls Debug if the inner type impls Debug, which would let me write code like this:
instead of what I have to write right now
It would also make it easier to work with error reporting:
instead of:
The text was updated successfully, but these errors were encountered: