Skip to content

Commit

Permalink
docs: Fix unclosed HTML tags errors (#1212)
Browse files Browse the repository at this point in the history
Signed-off-by: Thane Thomson <[email protected]>

Signed-off-by: Thane Thomson <[email protected]>
  • Loading branch information
thanethomson authored Oct 13, 2022
1 parent 035acab commit e830f85
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion proto/src/serializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//! All serializers are presented in a serializers::<Rust_nickname>::<JSON_representation_name>
//! format.
//!
//! This example shows how to serialize Vec<u8> into different types of strings:
//! This example shows how to serialize `Vec<u8>` into different types of strings:
//! ```ignore
//! use serde::{Serialize, Deserialize};
//! use crate::serializers;
Expand Down
24 changes: 12 additions & 12 deletions proto/src/serializers/bytes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Serialize/deserialize bytes (Vec<u8>) type
//! Serialize/deserialize bytes (`Vec<u8>`) type

/// Serialize into hexstring, deserialize from hexstring
pub mod hexstring {
Expand All @@ -7,7 +7,7 @@ pub mod hexstring {

use crate::prelude::*;

/// Deserialize hexstring into Vec<u8>
/// Deserialize hexstring into `Vec<u8>`
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -18,7 +18,7 @@ pub mod hexstring {
.map_err(serde::de::Error::custom)
}

/// Serialize from T into hexstring
/// Serialize from `T` into hexstring
pub fn serialize<S, T>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand All @@ -37,7 +37,7 @@ pub mod base64string {

use crate::prelude::*;

/// Deserialize base64string into Vec<u8>
/// Deserialize base64string into `Vec<u8>`
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where
D: Deserializer<'de>,
Expand Down Expand Up @@ -68,14 +68,14 @@ pub mod base64string {
}
}

/// Serialize into Vec<base64string>, deserialize from Vec<base64string>
/// Serialize into `Vec<base64string>`, deserialize from `Vec<base64string>`
pub mod vec_base64string {
use serde::{Deserialize, Deserializer, Serializer};
use subtle_encoding::base64;

use crate::prelude::*;

/// Deserialize array into Vec<Vec<u8>>
/// Deserialize array into `Vec<Vec<u8>>`
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<Vec<u8>>, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -87,7 +87,7 @@ pub mod vec_base64string {
.collect()
}

/// Serialize from Vec<T> into Vec<base64string>
/// Serialize from `Vec<T>` into `Vec<base64string>`
pub fn serialize<S, T>(value: &[T], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand All @@ -103,14 +103,14 @@ pub mod vec_base64string {
}
}

/// Serialize into Option<base64string>, deserialize from Option<base64string>
/// Serialize into `Option<base64string>`, deserialize from `Option<base64string>`
pub mod option_base64string {
use serde::{Deserialize, Deserializer, Serializer};
use subtle_encoding::base64;

use crate::prelude::*;

/// Deserialize Option<base64string> into Vec<u8> or null
/// Deserialize `Option<base64string>` into `Vec<u8>` or null
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -119,7 +119,7 @@ pub mod option_base64string {
base64::decode(&string).map_err(serde::de::Error::custom)
}

/// Serialize from T into Option<base64string>
/// Serialize from `T` into `Option<base64string>`
pub fn serialize<S, T>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand All @@ -137,7 +137,7 @@ pub mod string {

use crate::prelude::*;

/// Deserialize string into Vec<u8>
/// Deserialize string into `Vec<u8>`
#[allow(dead_code)]
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<u8>, D::Error>
where
Expand All @@ -147,7 +147,7 @@ pub mod string {
Ok(string.as_bytes().to_vec())
}

/// Serialize from T into string
/// Serialize from `T` into string
#[allow(dead_code)]
pub fn serialize<S, T>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down
6 changes: 3 additions & 3 deletions proto/src/serializers/nullable.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Serialize/deserialize `nil`able type into T, where nil turns into the default impl.
//! Serialize/deserialize `nil`able type into `T`, where `nil` turns into the default impl.
use serde::{Deserialize, Deserializer, Serialize, Serializer};

/// Deserialize Option<T>
/// Deserialize `Option<T>`
pub fn deserialize<'de, D, T>(deserializer: D) -> Result<T, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -10,7 +10,7 @@ where
Ok(Option::<T>::deserialize(deserializer)?.unwrap_or_default())
}

/// Serialize Option<T>
/// Serialize `Option<T>`
pub fn serialize<S, T>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
8 changes: 4 additions & 4 deletions proto/src/serializers/optional.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Serialize/deserialize Option<T> type where T has a serializer/deserializer.
//! Use `null` if the received value equals the Default implementation.
//! Serialize/deserialize `Option<T>` type where `T` has a serializer/deserializer.
//! Use `null` if the received value equals the `Default` implementation.
// Todo: Rename this serializer to something like "default_eq_none" to mirror its purpose better.
use serde::{Deserialize, Deserializer, Serialize, Serializer};

/// Deserialize Option<T>
/// Deserialize `Option<T>`
pub fn deserialize<'de, D, T>(deserializer: D) -> Result<Option<T>, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -12,7 +12,7 @@ where
Ok(Option::<T>::deserialize(deserializer)?.filter(|t| t != &T::default()))
}

/// Serialize Option<T>
/// Serialize `Option<T>`
pub fn serialize<S, T>(value: &Option<T>, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
6 changes: 3 additions & 3 deletions proto/src/serializers/txs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Serialize/deserialize Vec<Vec<u8>> type from and into transactions (Base64String array).
//! Serialize/deserialize `Vec<Vec<u8>>` type from and into transactions (Base64String array).
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use subtle_encoding::base64;

use crate::prelude::*;

/// Deserialize transactions into Vec<Vec<u8>>
/// Deserialize transactions into `Vec<Vec<u8>>`
pub fn deserialize<'de, D>(deserializer: D) -> Result<Vec<Vec<u8>>, D::Error>
where
D: Deserializer<'de>,
Expand All @@ -23,7 +23,7 @@ where
.collect()
}

/// Serialize from Vec<Vec<u8>> into transactions
/// Serialize from `Vec<Vec<u8>>` into transactions
pub fn serialize<S>(value: &[Vec<u8>], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
4 changes: 2 additions & 2 deletions tendermint/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum Hash {

impl Protobuf<Vec<u8>> for Hash {}

/// Default conversion from Vec<u8> is SHA256 Hash or None
/// Default conversion from `Vec<u8>` is SHA256 Hash or `None`
impl TryFrom<Vec<u8>> for Hash {
type Error = Error;

Expand Down Expand Up @@ -207,7 +207,7 @@ impl From<AppHash> for Vec<u8> {
}

impl AppHash {
/// Return AppHash value as vec<u8>
/// Return AppHash value as `Vec<u8>`
pub fn value(&self) -> Vec<u8> {
self.0.clone()
}
Expand Down
6 changes: 3 additions & 3 deletions tendermint/src/serializers/option_hash.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//! Option<Hash> serialization with validation
//! `Option<Hash>` serialization with validation

use serde::{Deserializer, Serializer};

use super::hash;
use crate::Hash;

/// Deserialize hexstring into Option<Hash>
/// Deserialize hexstring into `Option<Hash>`
pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<Hash>, D::Error>
where
D: Deserializer<'de>,
{
hash::deserialize(deserializer).map(Some)
}

/// Serialize from Option<Hash> into hexstring
/// Serialize from `Option<Hash>` into hexstring
pub fn serialize<S>(value: &Option<Hash>, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down

0 comments on commit e830f85

Please sign in to comment.