Skip to content

Commit

Permalink
ci: fix rustdoc job, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed May 16, 2023
1 parent 0aeb4a3 commit b640fea
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 91 deletions.
39 changes: 15 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,31 @@ env:

jobs:
test:
name: test ${{ matrix.os }} ${{ matrix.flags }}
runs-on: ${{ matrix.os }}
name: test ${{ matrix.rust }} ${{ matrix.flags }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
rust: ["stable", "beta", "nightly", "1.65"] # MSRV
flags: ["--no-default-features", "", "--all-features"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
toolchain: ${{ matrix.rust }}
# "skip" a UI test because of differing output
- run: rm crates/sol-types/tests/ui/type.*
if: ${{ matrix.rust }} == '1.65'
- name: test
run: cargo +stable test --workspace ${{ matrix.flags }}
run: cargo test --workspace ${{ matrix.flags }}

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: clippy
run: cargo clippy --workspace --tests
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy --workspace --tests
env:
RUSTFLAGS: -Dwarnings

Expand All @@ -47,24 +43,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-docs
- uses: Swatinem/rust-cache@v2
- name: doc
run: cargo doc --workspace --no-deps --document-private-items
- run: cargo doc --workspace --no-deps --document-private-items
env:
RUSTDOCFLAGS: "-D warnings"

fmt:
name: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: fmt --check
run: cargo fmt --all --check
- run: cargo fmt --all --check
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["crates/*"]

[workspace.package]
edition = "2021"
rust-version = "1.65"
rust-version = "1.65" # Remember to update .clippy.toml and workflows/ci.yml
authors = []
license = "MIT OR Apache-2.0"
homepage = "https://github.com/ethers-rs/core"
Expand Down
36 changes: 0 additions & 36 deletions crates/sol-types/src/coder/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,6 @@
// except according to those terms.
//

//! ABI decoder.
//!
//! ### `encode/decode_single`
//!
//! [`crate::SolType::encode_single()`] and [`decode_single()`] operate on a
//! single token. They wrap this token in a tuple, and pass it to the encoder.
//! Use this interface when abi-encoding a single token. This is suitable for
//! encoding a type in isolation, or for encoding parameters for single-param
//! functions.
//!
//! The corresponding [`crate::SolType::decode()`] and
//! [`decode()`] reverse this operation, decoding a single type from a
//! blob.
//!
//! ### `encode/decode_params`
//!
//! [`crate::SolType::encode_params()`] and [`encode_params()`] operate on a
//! sequence. If the sequence is a tuple, the tuple is inferred to be a set of
//! Solidity function parameters,
//!
//! The corresponding [`crate::SolType::decode_params()`] and
//! [`decode_params()`] reverse this operation, decoding a tuple from a
//! blob.
//!
//! This is used to encode/decode the parameters for a Solidity function.
//!
//! ### `encode/decode`
//!
//! [`crate::SolType::encode()`] and [`encode()`] operate on a sequence of
//! tokens. This sequence is inferred not to be function parameters. This is
//! the least useful one. Most users will not need it. It wraps the input in a
//! tuple, and then encodes.
//!
//! [`crate::SolType::decode()`] and [`decode()`] reverse this, by attempting
//! to decode the type from inside a tuple.

use crate::{encode, no_std_prelude::*, token::TokenSeq, util, Error, Result, TokenType, Word};
use core::{fmt, slice::SliceIndex};

Expand Down
29 changes: 0 additions & 29 deletions crates/sol-types/src/coder/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! ABI encoder.
//!
//! ### `encode/decode_single`
//!
//! [`crate::SolType::encode_single()`] and [`encode_single()`] operate on a
//! single token. They wrap this token in a tuple, and pass it to the encoder.
//! Use this interface when abi-encoding a single token. This is suitable for
//! encoding a type in isolation, or for encoding parameters for single-param
//! functions.
//!
//! ### `encode/decode_params`
//!
//! [`crate::SolType::encode_params()`] and [`encode_params()`] operate on a
//! sequence. If the sequence is a tuple, the tuple is inferred to be a set of
//! Solidity function parameters,
//!
//! The corresponding [`crate::SolType::decode_params()`] and
//! [`crate::decode_params()`] reverse this operation, decoding a tuple from a
//! blob.
//!
//! This is used to encode the parameters for a Solidity function
//!
//! ### `encode/decode`
//!
//! [`crate::SolType::encode()`] and [`encode()`] operate on a sequence of
//! tokens. This sequence is inferred not to be function parameters.
//!
//! This is the least useful one. Most users will not need it.

use crate::{no_std_prelude::*, token::TokenSeq, util::pad_u32, TokenType, Word};
use core::mem;

Expand Down
29 changes: 28 additions & 1 deletion crates/sol-types/src/coder/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
//! Encoding/Decoding
//! ABI encoder.
//!
//! ### `encode/decode_single`
//!
//! [`crate::SolType::encode_single()`] and [`encode_single()`] operate on a
//! single token. They wrap this token in a tuple, and pass it to the encoder.
//! Use this interface when abi-encoding a single token. This is suitable for
//! encoding a type in isolation, or for encoding parameters for single-param
//! functions.
//!
//! ### `encode/decode_params`
//!
//! [`crate::SolType::encode_params()`] and [`encode_params()`] operate on a
//! sequence. If the sequence is a tuple, the tuple is inferred to be a set of
//! Solidity function parameters,
//!
//! The corresponding [`crate::SolType::decode_params()`] and
//! [`crate::decode_params()`] reverse this operation, decoding a tuple from a
//! blob.
//!
//! This is used to encode the parameters for a Solidity function
//!
//! ### `encode/decode`
//!
//! [`crate::SolType::encode()`] and [`encode()`] operate on a sequence of
//! tokens. This sequence is inferred not to be function parameters.
//!
//! This is the least useful one. Most users will not need it.

mod impl_core;

Expand Down

0 comments on commit b640fea

Please sign in to comment.