docs: improve organization of function docstrings

This commit is contained in:
rzmk 2023-09-21 16:48:29 -04:00
parent b4d484686f
commit 563133d635
No known key found for this signature in database

View file

@ -2,9 +2,11 @@ use std::collections::HashSet;
/// Finds all factor pairs for a positive integer `n`. /// Finds all factor pairs for a positive integer `n`.
/// ///
/// This function calculates and returns a `HashSet<(u32, u32)>` containing all unique factor pairs /// A factor pair is a pair of positive integers
/// of the input positive integer `n`. 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`). /// `(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`.
/// ///
/// # Examples /// # Examples
/// ///
@ -42,10 +44,12 @@ pub fn get_factor_pairs(n: u32) -> HashSet<(u32, u32)> {
} }
/// Finds all factors of a positive integer `n`. /// 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`).
/// ///
/// This function calculates and returns a `HashSet<u32>` containing all unique factors /// This function calculates and returns a `HashSet<u32>` containing all unique factors
/// of the input positive integer `n`. A factor of `n` is a positive integer `a` where /// of the input positive integer `n`.
/// `n` is evenly divisible by `a` (i.e., `n % a == 0`).
/// ///
/// # Examples /// # Examples
/// ///