Skip to content

Commit

Permalink
Fix doc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fbernier committed Nov 7, 2024
1 parent ff52e36 commit 487b863
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
`base62` is a `no_std` crate (requires [`alloc`](alloc)) that has six functions for
`base62` is a `no_std` crate (requires [`alloc`]) that has six functions for
encoding to and decoding from [base62](https://en.wikipedia.org/wiki/Base62).
[![Build status](https://github.com/fbernier/base62/workflows/ci/badge.svg)](https://github.com/fbernier/base62/actions)
Expand Down Expand Up @@ -33,11 +33,11 @@ const BASE_TO_19: u128 = BASE_TO_18 * BASE as u128;
const BASE_TO_20: u128 = BASE_TO_19 * BASE as u128;
const BASE_TO_21: u128 = BASE_TO_20 * BASE as u128;

/// Indicates the cause of a decoding failure in [`decode`](crate::decode) or
/// [`decode_alternative`](crate::decode_alternative).
/// Indicates the cause of a decoding failure in [`decode`] or
/// [`decode_alternative`].
#[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DecodeError {
/// The decoded number cannot fit into a [`u128`](core::primitive::u128).
/// The decoded number cannot fit into a [`u128`].
ArithmeticOverflow,

/// The encoded input is an empty string.
Expand Down Expand Up @@ -448,11 +448,11 @@ macro_rules! internal_decoder_fn {
internal_decoder_fn!(_decode, 0, 10, 36);
internal_decoder_fn!(_decode_alternative, 0, 36, 10);

/// Decodes a base62 byte slice or an equivalent, like a [`String`](alloc::string::String),
/// Decodes a base62 byte slice or an equivalent, like a [`String`],
/// using the standard digit ordering (0 to 9, then A to Z, then a to z).
///
/// Returns a [`Result`](core::result::Result) containing the decoded
/// [`u128`](core::primitive::u128) or a [`DecodeError`](crate::DecodeError).
/// Returns a [`Result`] containing the decoded
/// [`u128`] or a [`DecodeError`].
///
/// # Examples
///
Expand All @@ -467,12 +467,12 @@ pub fn decode<T: AsRef<[u8]>>(input: T) -> Result<u128, DecodeError> {
_decode(input.as_ref())
}

/// Decodes a base62 byte slice or an equivalent, like a [`String`](alloc::string::String),
/// Decodes a base62 byte slice or an equivalent, like a [`String`],
/// using the alternative digit ordering (0 to 9, then a to z, then A to Z) with lowercase
/// letters before uppercase letters.
///
/// Returns a [`Result`](core::result::Result) containing the decoded
/// [`u128`](core::primitive::u128) or a [`DecodeError`](crate::DecodeError).
/// Returns a [`Result`] containing the decoded
/// [`u128`] or a [`DecodeError`].
///
/// # Examples
///
Expand Down Expand Up @@ -624,7 +624,7 @@ internal_encoder_fn!(_encode_alternative_buf, b'0', b'a', b'A');

/// Encodes an unsigned integer into base62, using the standard digit ordering
/// (0 to 9, then A to Z, then a to z), and returns the resulting
/// [`String`](alloc::string::String).
/// [`String`].
///
/// # Example
///
Expand All @@ -649,7 +649,7 @@ pub fn encode<T: Into<u128>>(num: T) -> String {

/// Encodes an unsigned integer into base62, using the standard digit ordering
/// (0 to 9, then A to Z, then a to z), and then appends it onto the end of the given
/// [`String`](alloc::string::String).
/// [`String`].
///
/// # Example
///
Expand Down Expand Up @@ -751,7 +751,7 @@ pub fn encode_alternative_bytes<T: Into<u128>>(

/// Encodes an unsigned integer into base62, using the alternative digit ordering
/// (0 to 9, then a to z, then A to Z) with lowercase letters before uppercase letters,
/// and returns the resulting [`String`](alloc::string::String).
/// and returns the resulting [`String`].
///
/// # Example
///
Expand All @@ -776,7 +776,7 @@ pub fn encode_alternative<T: Into<u128>>(num: T) -> String {

/// Encodes an unsigned integer into base62, using the alternative digit ordering
/// (0 to 9, then a to z, then A to Z) with lowercase letters before uppercase letters, and
/// then appends it onto the end of the given [`String`](alloc::string::String).
/// then appends it onto the end of the given [`String`].
///
/// # Example
///
Expand Down

0 comments on commit 487b863

Please sign in to comment.