From 857f1b03b9cde5863dac88470cc768ba0c13a5d3 Mon Sep 17 00:00:00 2001 From: rzmk Date: Thu, 21 Sep 2023 17:06:31 -0400 Subject: [PATCH] docs: include subject description under Subjects in crate home page --- ladderz/src/lib.rs | 14 +++++++------- ladderz/src/pre_algebra/unit1.rs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ladderz/src/lib.rs b/ladderz/src/lib.rs index 3a1656a..9366bcc 100644 --- a/ladderz/src/lib.rs +++ b/ladderz/src/lib.rs @@ -2,11 +2,11 @@ //! //! Implementations of mathematical and technical concepts in Rust. //! -//! ## Subjects +//! # Subjects //! //! The modules for currently supported subjects are: //! -//! - [`pre_algebra`] +//! - [pre_algebra] - Various pre-algebra implementations including factor pairs, factors, multiples, and more. //! //! # Example //! @@ -93,20 +93,20 @@ //! Great! We've successfully used the `ladderz` crate to get the factors and factor pairs of a positive integer in sorted order. /// Various pre-algebra implementations including factor pairs, factors, multiples, and more. -/// +/// /// # Example -/// +/// /// ```rust /// use ladderz::pre_algebra::get_factors; -/// +/// /// fn main() { /// let x: u32 = 10; /// println!("The factors of {x} are {:?}.", get_factors(x)); /// } /// ``` -/// +/// /// ```console /// The factors of 10 are {1, 5, 2, 10}. /// ``` -/// +/// pub mod pre_algebra; diff --git a/ladderz/src/pre_algebra/unit1.rs b/ladderz/src/pre_algebra/unit1.rs index c1b1737..fbcfa14 100644 --- a/ladderz/src/pre_algebra/unit1.rs +++ b/ladderz/src/pre_algebra/unit1.rs @@ -4,7 +4,7 @@ use std::collections::HashSet; /// /// A factor pair is a pair of positive integers /// `(a, b)` where `a` and `b` are both factors of `n` (i.e., `a * b == n`). -/// +/// /// This function calculates and returns a `HashSet<(u32, u32)>` containing all unique factor pairs /// of the input positive integer `n`. /// @@ -44,7 +44,7 @@ pub fn get_factor_pairs(n: u32) -> HashSet<(u32, u32)> { } /// Finds all factors of a positive integer `n`. -/// +/// /// A factor of `n` is a positive integer `a` where /// `n` is evenly divisible by `a` (i.e., `n % a == 0`). ///