-
Notifications
You must be signed in to change notification settings - Fork 99
Support for DecodeWithMemTracking with Cow<'static, str> #734
Copy link
Copy link
Closed
Description
I having some issues when trying to add DecodeWithMemTracking in an enum with Cow<'static, str>
#[cfg_attr(
feature = "with-codec",
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
pub enum ExitFatal {
/// The operation is not supported.
NotSupported,
/// The trap (interrupt) is unhandled.
UnhandledInterrupt,
/// The environment explicitly set call errors as fatal error.
CallErrorAsFatal(ExitError),
/// Other fatal errors.
Other(Cow<'static, str>),
}
The error is:
the trait `DecodeWithMemTracking` is not implemented for `str`, which is required by `Cow<'static, str>: DecodeWithMemTracking
Is there any way to support this without replacing the Cow<'static, str> to String?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels