From f1f820bdbb8ed7893884f93f9a068b1eac229f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= <26653921+dj8yfo@users.noreply.github.com> Date: Tue, 24 Oct 2023 23:05:22 +0300 Subject: [PATCH] chore: addressed warnings in docs generation (#252) --- .github/workflows/rust.yml | 6 ++++-- borsh-derive/src/lib.rs | 8 ++++---- borsh/src/de/mod.rs | 2 +- borsh/src/lib.rs | 22 +++++++++++----------- borsh/src/schema.rs | 2 +- borsh/src/ser/mod.rs | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4da73c46f..68d887a69 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,9 +37,11 @@ jobs: - name: print rustc version run: rustc --version # remove this step when MSRV >= 1.67.0 - - name: downgrade `time` crate to support older Rust toolchain + - name: downgrade `time`, `toml_datetime` crate to support older Rust toolchain if: matrix.rust_version == '1.66.0' - run: cargo update -p time --precise 0.3.23 + run: | + cargo update -p time --precise 0.3.23 + cargo update -p toml_datetime --precise 0.6.3 - name: Run tests run: ./.github/test.sh diff --git a/borsh-derive/src/lib.rs b/borsh-derive/src/lib.rs index c5e8d48f9..ae541187b 100644 --- a/borsh-derive/src/lib.rs +++ b/borsh-derive/src/lib.rs @@ -67,7 +67,7 @@ struct A { ###### syntax -Attribute takes literal string value, which is the [Path](syn::Path) to `borsh` crate used. +Attribute takes literal string value, which is the syn's [Path] to `borsh` crate used. ###### usage @@ -354,7 +354,7 @@ struct A { ###### syntax -Attribute takes literal string value, which is the [Path](syn::Path) to `borsh` crate used. +Attribute takes literal string value, which is the syn's [Path] to `borsh` crate used. ###### usage @@ -407,7 +407,7 @@ struct B { ###### syntax -Attribute's value is syn's [Path](syn::Path)-s, passed to borsh top level meta attribute as value of `init` argument. +Attribute's value is syn's [Path]-s, passed to borsh top level meta attribute as value of `init` argument. ###### usage @@ -690,7 +690,7 @@ struct A { ###### syntax -Attribute takes literal string value, which is the [Path](syn::Path) to `borsh` crate used. +Attribute takes literal string value, which is the syn's [Path] to `borsh` crate used. ###### usage diff --git a/borsh/src/de/mod.rs b/borsh/src/de/mod.rs index 0d84a8dcb..ed57938e1 100644 --- a/borsh/src/de/mod.rs +++ b/borsh/src/de/mod.rs @@ -463,7 +463,7 @@ where #[cfg(hash_collections)] pub mod hashes { //! - //! Module defines [BorshDeserialize](crate::de::BorshDeserialize) implementation for + //! Module defines [BorshDeserialize] implementation for //! [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet). use core::hash::{BuildHasher, Hash}; diff --git a/borsh/src/lib.rs b/borsh/src/lib.rs index 87af12d7b..9091b6272 100644 --- a/borsh/src/lib.rs +++ b/borsh/src/lib.rs @@ -25,31 +25,31 @@ ### Other features * **derive** - - Gates derive macros of [BorshSerialize](crate::ser::BorshSerialize) and - [BorshDeserialize](crate::de::BorshDeserialize) traits. + Gates derive macros of [BorshSerialize] and + [BorshDeserialize] traits. * **unstable__schema** - - Gates [BorshSchema](crate::schema::BorshSchema) trait and its derive macro. - Gates [schema](crate::schema) module. + Gates [BorshSchema] trait and its derive macro. + Gates [schema] module. This feature requires **derive** to be enabled too. * **rc** - - Gates implementation of [BorshSerialize](crate::ser::BorshSerialize) and [BorshDeserialize](crate::de::BorshDeserialize) + Gates implementation of [BorshSerialize] and [BorshDeserialize] for [`Rc`](std::rc::Rc)/[`Arc`](std::sync::Arc) respectively. In `no_std` setting `Rc`/`Arc` are pulled from `alloc` crate. * **hashbrown** - Pulls in [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet) when no `std` is available. This feature is set to be mutually exclusive with **std** feature. * **bytes** - - Gates implementation of [BorshSerialize](crate::ser::BorshSerialize) and [BorshDeserialize](crate::de::BorshDeserialize) + Gates implementation of [BorshSerialize] and [BorshDeserialize] for [Bytes](bytes::Bytes) and [BytesMut](bytes::BytesMut). * **bson** - - Gates implementation of [BorshSerialize](crate::ser::BorshSerialize) and [BorshDeserialize](crate::de::BorshDeserialize) + Gates implementation of [BorshSerialize] and [BorshDeserialize] for [ObjectId](bson::oid::ObjectId). * **de_strict_order** - Enables check that keys, parsed during deserialization of [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet) and [BTreeSet](std::collections::BTreeSet)/[BTreeMap](std::collections::BTreeMap) - are encountered in ascending order with respect to [PartialOrd](core::cmp::PartialOrd) for hash collections, - and [Ord](core::cmp::Ord) for btree ones. Deserialization emits error otherwise. + are encountered in ascending order with respect to [PartialOrd] for hash collections, + and [Ord] for btree ones. Deserialization emits error otherwise. If this feature is not enabled, it is possible that two different byte slices could deserialize into the same `HashMap`/`HashSet` object. @@ -57,8 +57,8 @@ * **hash_collections** - This is a feature alias, set up in `build.rs` to be equivalent to (**std** OR **hashbrown**). - Gates implementation of [BorshSerialize](crate::ser::BorshSerialize), [BorshDeserialize](crate::de::BorshDeserialize) - and [BorshSchema](crate::schema::BorshSchema) + Gates implementation of [BorshSerialize], [BorshDeserialize] + and [BorshSchema] for [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet). diff --git a/borsh/src/schema.rs b/borsh/src/schema.rs index 0fce4652a..47c8fa0f4 100644 --- a/borsh/src/schema.rs +++ b/borsh/src/schema.rs @@ -541,7 +541,7 @@ where #[cfg(hash_collections)] pub mod hashes { //! - //! Module defines [BorshSchema](crate::schema::BorshSchema) implementation for + //! Module defines [BorshSchema] implementation for //! [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet). use crate::BorshSchema; diff --git a/borsh/src/ser/mod.rs b/borsh/src/ser/mod.rs index e0f9f671c..1410edf1a 100644 --- a/borsh/src/ser/mod.rs +++ b/borsh/src/ser/mod.rs @@ -328,7 +328,7 @@ where #[cfg(hash_collections)] pub mod hashes { //! - //! Module defines [BorshSerialize](crate::ser::BorshSerialize) implementation for + //! Module defines [BorshSerialize] implementation for //! [HashMap](std::collections::HashMap)/[HashSet](std::collections::HashSet). use crate::__private::maybestd::vec::Vec; use crate::error::check_zst;