From 7a4a85dd01274ad24c0258ec84e636a22f30f6d5 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 10 Feb 2021 21:59:01 +0100 Subject: [PATCH] Fix rendering of documentation on docs.rs (#807) * Fix rendering of documentation on docs.rs * Add workflow to build docs on nightly (with same config as docs.rs) * Update changelog * Fix doc build errors and allow warnings in generated files * Fix some more non-autolinks * Fix more clippy warnings * Formatting * Fix last remaining comment --- .github/workflows/rust.yml | 15 +++++++++++++++ proto/src/lib.rs | 4 +++- proto/src/serializers/part_set_header_total.rs | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1872d30..f20e74f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,3 +43,18 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features --all-targets + + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + env: + RUSTFLAGS: "--cfg docsrs" + with: + command: doc + args: --all-features diff --git a/proto/src/lib.rs b/proto/src/lib.rs index 95624e1..5f6b110 100644 --- a/proto/src/lib.rs +++ b/proto/src/lib.rs @@ -5,7 +5,8 @@ #![forbid(unsafe_code)] #![doc(html_root_url = "https://docs.rs/tendermint-proto/0.18.0")] -// Built-in prost_types with slight customization to enable JSON-encoding +/// Built-in prost_types with slight customization to enable JSON-encoding +#[allow(warnings)] pub mod google { pub mod protobuf { include!("prost/google.protobuf.rs"); @@ -14,6 +15,7 @@ pub mod google { } } +#[allow(warnings)] mod tendermint; pub use tendermint::*; diff --git a/proto/src/serializers/part_set_header_total.rs b/proto/src/serializers/part_set_header_total.rs index 54f6aa2..11d3dea 100644 --- a/proto/src/serializers/part_set_header_total.rs +++ b/proto/src/serializers/part_set_header_total.rs @@ -4,7 +4,7 @@ //! The deserializer is created for backwards compatibility: `total` was changed from a //! string-quoted integer value into an integer value without quotes in Tendermint Core v0.34.0. //! This deserializer allows backwards-compatibility by deserializing both ways. -//! See also: https://github.com/informalsystems/tendermint-rs/issues/679 +//! See also: use serde::{de::Error, de::Visitor, Deserializer, Serialize, Serializer}; use std::convert::TryFrom; use std::fmt::Formatter;