Skip to content
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

Reexport parity-scale-codec for derive #106

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ fn generate_type(input: TokenStream2) -> Result<TokenStream2> {
let attrs = attr::Attributes::from_ast(&ast)?;

let scale_info = crate_name_ident("scale-info")?;
let parity_scale_codec = crate_name_ident("parity-scale-codec")?;

let ident = &ast.ident;

Expand All @@ -75,7 +74,6 @@ fn generate_type(input: TokenStream2) -> Result<TokenStream2> {
&ast.generics,
&ast.data,
&scale_info,
&parity_scale_codec,
)?;

let (impl_generics, ty_generics, _) = ast.generics.split_for_impl();
Expand Down
3 changes: 1 addition & 2 deletions derive/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ pub fn make_where_clause<'a>(
generics: &'a Generics,
data: &'a syn::Data,
scale_info: &Ident,
parity_scale_codec: &Ident,
) -> Result<WhereClause> {
let mut where_clause = generics.where_clause.clone().unwrap_or_else(|| {
WhereClause {
Expand Down Expand Up @@ -97,7 +96,7 @@ pub fn make_where_clause<'a>(
if is_compact {
where_clause
.predicates
.push(parse_quote!(#ty : :: #parity_scale_codec ::HasCompact));
.push(parse_quote!(#ty : :: #scale_info :: scale::HasCompact));
} else {
where_clause
.predicates
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ mod utils;
#[cfg(test)]
mod tests;

#[doc(hidden)]
pub use scale;

pub use self::{
meta_type::MetaType,
registry::{
Expand Down