Check docs and run clippy on PRs (#326)

* Check docs, clippy, test run

* test parallel CI adapted from other package; is it faster?

* Remember to download substrate

* Nightly for cargo fmt

* Standardise CI names

* fix clippy complaints

* Ensure docs are valid and export publicly accessible types

* all-targets clippy, and fix additional lint errors

* newline in ci file
This commit is contained in:
James Wilson
2021-11-19 10:36:38 +00:00
committed by GitHub
parent dcb78a2784
commit 97f4112e92
16 changed files with 190 additions and 79 deletions
+8 -6
View File
@@ -96,7 +96,11 @@ pub use crate::{
Signer,
UncheckedExtrinsic,
},
metadata::Metadata,
metadata::{
Metadata,
MetadataError,
PalletMetadata,
},
rpc::{
BlockNumber,
ExtrinsicSuccess,
@@ -167,10 +171,8 @@ pub enum Phase {
/// A wrapper for any type `T` which implement encode/decode in a way compatible with `Vec<u8>`.
///
/// This type is similar to [`WrapperOpaque`], but it differs in the way it stores the type `T`.
/// While [`WrapperOpaque`] stores the decoded type, the [`WrapperKeepOpaque`] stores the type only
/// in its opaque format, aka as a `Vec<u8>`. To access the real type `T` [`Self::try_decode`] needs
/// to be used.
/// [`WrapperKeepOpaque`] stores the type only in its opaque format, aka as a `Vec<u8>`. To
/// access the real type `T` [`Self::try_decode`] needs to be used.
#[derive(Debug, Eq, PartialEq, Default, Clone, Decode, Encode)]
pub struct WrapperKeepOpaque<T> {
data: Vec<u8>,
@@ -182,7 +184,7 @@ impl<T: Decode> WrapperKeepOpaque<T> {
///
/// Returns `None` if the decoding failed.
pub fn try_decode(&self) -> Option<T> {
T::decode_all(&mut &self.data[..]).ok()
T::decode_all(&self.data[..]).ok()
}
/// Returns the length of the encoded `T`.