New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename Compact to Portable #41
Conversation
By default, parity-scale-codec does not provide Encode/Decode impls for an owned String. This is only provided under the "full" feature which is not used by the substrate runtime, because it should not be used for consensus critical code. So in order for the CompactForm to be integrated into the substrate runtime, or wherever the "full" feature cannot be used, then we must parameterize the `String` type so that it can be both an `&'static str` on the runtime side where it is encoded, and a `String` in client/consuming code where it is decoded.
Add a `compact` member to `Field` to indicate it is `scale_codec::Compact`
What about "Portable"? |
|
Cannot come up with a better idea for another name. Names never bothered me anyway. |
@ascjones ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib.rs
Outdated
//! There is an uncompact form, called [`MetaForm`](`crate::form::MetaForm`) that acts as a bridge | ||
//! from compile-time type information at runtime in order to easily retrieve all information needed | ||
//! to uniquely identify types. | ||
//! There is an expanded form, called [`MetaForm`](`crate::form::MetaForm`) that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think expanded
is the right word here. That said, I'm not sure what the right word would be here either. Could maybe just remove There is an expanded form
and just use the rest of the sentence. Or something to describe that this is how types are described and identified statically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole paragraph is a bit weird imo. Hard to rewrite because I'm not sure I understand it myself. Changing to:
//! # Forms
//!
//! To bridge between compile-time type information and runtime the
//! [`MetaForm`](`crate::form::MetaForm`) is used to easily retrieve all
//! information needed to uniquely identify types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to suggest moar betterments, happy to make the changes.
Based on #35 (aj-compact-string).
This PR changes the terminology from
compact
intofrozen
, which is useful to avoid confusion with the terminology used inparity-scale-codec
, where theCompact
type has a prominent role (c.f. #8)."Frozen" is a sub-optimal name. Other candidates include:
Universal
(too vague),Static
(confusing),Standalone
(too vauge),Decontexualized
(is that even a word?),Fixed
(seems to imply something about space usage),Exported
(that's not the key aspect though is it?),Serializable
(kind of confusing withserde
being in the mix).Also included: a bunch of edits to the documentation in the hope of improving readability a bit.