Skip to content

Commit

Permalink
Add whitespace around docstring section headings
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Dec 16, 2023
1 parent 2910371 commit d87abe5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ pub fn zalgo_encode(string: &str) -> Result<String, Error> {
/// If you want to be able to decode without this check, consider using a [`ZalgoString`].
///
/// # Examples
///
/// Basic usage:
/// ```
/// # use zalgo_codec_common::zalgo_decode;
Expand Down Expand Up @@ -230,6 +231,7 @@ fn decode_byte_pair(odd: u8, even: u8) -> u8 {
/// The resulting Python code should retain the functionality of the original.
///
/// # Example
///
/// Encode a simple hello world program in Python
/// ```
/// # use zalgo_codec_common::{Error, zalgo_wrap_python};
Expand Down Expand Up @@ -289,6 +291,7 @@ pub enum Error {

impl Error {
/// Returns the 1-indexed line number of the line on which the unencodable byte occured.
///
/// # Examples
/// ```
/// # use zalgo_codec_common::{Error, zalgo_encode};
Expand All @@ -304,6 +307,7 @@ impl Error {

/// Returns the 1-indexed column where the unencodable byte occured.
/// Columns are counted from left to right and the count resets for each new line.
///
/// # Example
/// ```
/// # use zalgo_codec_common::{Error, zalgo_encode};
Expand All @@ -318,7 +322,9 @@ impl Error {
}

/// Returns the value of the first byte of the unencodable character.
///
/// # Examples
///
/// ```
/// # use zalgo_codec_common::{Error, zalgo_encode};
/// assert_eq!(zalgo_encode("\r").err().unwrap().byte(), 13);
Expand All @@ -342,7 +348,9 @@ impl Error {
/// This exists if the character is an unencodable ASCII character.
/// If it is some other unicode character we only know its first byte, so we can not
/// accurately represent it.
///
/// # Examples
///
/// ```
/// # use zalgo_codec_common::zalgo_encode;
/// assert_eq!(zalgo_encode("\r").err().unwrap().representation(), Some("Carriage Return"));
Expand Down

0 comments on commit d87abe5

Please sign in to comment.