docs: make mention of modules section & run rustfmt

This commit is contained in:
rzmk 2023-09-21 08:02:55 -04:00
parent 98f459c747
commit 3673f6df8e
No known key found for this signature in database
2 changed files with 10 additions and 8 deletions

View file

@ -2,6 +2,8 @@
//! //!
//! Implementations of mathematical and technical concepts in Rust. //! Implementations of mathematical and technical concepts in Rust.
//! //!
//! View [the modules section](#modules) for the various implementations based on the subject.
//!
//! # Example //! # Example
//! //!
//! Here's an example of using the `ladderz` crate to get the factors and factor pairs of a number in sorted order. //! Here's an example of using the `ladderz` crate to get the factors and factor pairs of a number in sorted order.

View file

@ -223,7 +223,7 @@ pub fn is_multiple(x: u32, y: u32) -> bool {
pub fn get_multiples_in_range(n: u32, end: u32) -> HashSet<u32> { pub fn get_multiples_in_range(n: u32, end: u32) -> HashSet<u32> {
let mut multiples: HashSet<u32> = HashSet::new(); let mut multiples: HashSet<u32> = HashSet::new();
for num in n..end+1 { for num in n..end + 1 {
if num % n == 0 { if num % n == 0 {
multiples.insert(num); multiples.insert(num);
} }
@ -264,7 +264,7 @@ mod tests {
assert_eq!(result, expected); assert_eq!(result, expected);
let result_2: bool = false; let result_2: bool = false;
let expected_2: bool = is_factor(3, 10); let expected_2: bool = is_factor(3, 10);
assert_eq!(result_2, expected_2); assert_eq!(result_2, expected_2);
} }