Skip to content

Commit 77ec98a

Browse files
committed
clippy
1 parent 8dcbf13 commit 77ec98a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/general/huffman_encoding.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ pub struct HuffmanDictionary<T> {
7878

7979
impl<T: Clone + Copy + Ord> HuffmanDictionary<T> {
8080
/// Creates a new Huffman dictionary from alphabet symbols and their frequencies.
81-
///
81+
///
8282
/// Returns `None` if the alphabet is empty.
83-
///
83+
///
8484
/// # Arguments
8585
/// * `alphabet` - A slice of tuples containing symbols and their frequencies
86-
///
86+
///
8787
/// # Example
8888
/// ```
8989
/// # use the_algorithms_rust::general::HuffmanDictionary;

src/machine_learning/loss_function/kl_divergence_loss.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn kld_loss(actual: &[f64], predicted: &[f64]) -> f64 {
1616
let loss: f64 = actual
1717
.iter()
1818
.zip(predicted.iter())
19-
.map(|(&a, &p)| ((a + eps) * ((a + eps) / (p + eps)).ln()))
19+
.map(|(&a, &p)| (a + eps) * ((a + eps) / (p + eps)).ln())
2020
.sum();
2121
loss
2222
}

0 commit comments

Comments
 (0)