Improve documentation (#449)

* cli: Remove whitespaces from readme

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* cli: Fix typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Modify codegen path

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Remove rustfmt arguments

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* cli: Update Readme

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* examples: Fix typo

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* subxt: Add Hash for WrapperKeepOpaque and PhantomDataSendSync

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile authored and GitHub committed 2022-02-14 20:01:40 +02:00
1 parent b1b717332e
commit 5c04b09c78
4 files changed
+9 -7

No files matched your search

+2 -2
View File
@@ -37,8 +37,8 @@ OPTIONS:
## Codegen ## Codegen
Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the the runtime API and types. Useful Use to invoke the `subxt-codegen` crate which is used by `subxt-macro` to generate the runtime API and types. Useful
for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility of customizing the for troubleshooting codegen as an alternative to `cargo expand`, and also provides the possibility to customize the
generated code if the macro does not produce the desired API. e.g. generated code if the macro does not produce the desired API. e.g.
`subxt codegen | rustfmt --edition=2018 --emit=stdout` `subxt codegen | rustfmt --edition=2018 --emit=stdout`
+2 -2
View File
@@ -22,9 +22,9 @@
runtime_metadata_path = "examples/polkadot_metadata.scale", runtime_metadata_path = "examples/polkadot_metadata.scale",
// We can add (certain) custom derives to the generated types by providing // We can add (certain) custom derives to the generated types by providing
// a comma separated list to the below attribute. Most useful for adding `Clone`. // a comma separated list to the below attribute. Most useful for adding `Clone`.
// The derives that we can add ultiamtely is limited to the traits that the base // The derives that we can add ultimately is limited to the traits that the base
// types relied upon by the codegen implement. // types relied upon by the codegen implement.
generated_type_derives = "Clone, PartialEq" generated_type_derives = "Clone, PartialEq, Hash"
)] )]
pub mod polkadot {} pub mod polkadot {}
+4 -2
View File
@@ -180,7 +180,8 @@ pub enum Phase {
Clone(bound = ""), Clone(bound = ""),
PartialEq(bound = ""), PartialEq(bound = ""),
Eq(bound = ""), Eq(bound = ""),
Default(bound = "") Default(bound = ""),
Hash(bound = "")
)] )]
pub struct WrapperKeepOpaque<T> { pub struct WrapperKeepOpaque<T> {
data: Vec<u8>, data: Vec<u8>,
@@ -223,7 +224,8 @@ impl<T: Decode> WrapperKeepOpaque<T> {
PartialEq(bound = ""), PartialEq(bound = ""),
Debug(bound = ""), Debug(bound = ""),
Eq(bound = ""), Eq(bound = ""),
Default(bound = "") Default(bound = ""),
Hash(bound = "")
)] )]
#[scale_info(skip_type_params(T))] #[scale_info(skip_type_params(T))]
#[doc(hidden)] #[doc(hidden)]
+1 -1
View File
@@ -20,7 +20,7 @@
/// Generate by: /// Generate by:
/// ///
/// - run `polkadot --dev --tmp` node locally /// - run `polkadot --dev --tmp` node locally
/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` /// - `cargo run --release -p subxt-cli -- codegen | rustfmt > subxt/tests/integration/codegen/polkadot.rs`
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::all)] #[allow(clippy::all)]
mod polkadot; mod polkadot;