Skip to content

Commit

Permalink
Fix new clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
robamler committed Sep 4, 2023
1 parent 85068d8 commit 93b8fa6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ let mut coder = DefaultAnsCoder::new();

// Define some data and a sequence of entropy models. We use quantized Gaussians here,
// but `constriction` also provides other models and allows you to implement your own.
let symbols = vec![23i32, -15, 78, 43, -69];
let symbols = [23i32, -15, 78, 43, -69];
let quantizer = DefaultLeakyQuantizer::new(-100..=100);
let means = vec![35.2f64, -1.7, 30.1, 71.2, -75.1];
let stds = vec![10.1f64, 25.3, 23.8, 35.4, 3.9];
let means = [35.2f64, -1.7, 30.1, 71.2, -75.1];
let stds = [10.1f64, 25.3, 23.8, 35.4, 3.9];
let models = means.iter().zip(&stds).map(
|(&mean, &std)| quantizer.quantize(probability::distribution::Gaussian::new(mean, std))
);
Expand Down
2 changes: 1 addition & 1 deletion src/pybindings/stream/model/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
{
#[inline]
fn clone(&self) -> Self {
Self(self.0)
*self
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/stream/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ mod tests {
let coder2 = ChainCoder::from_remainders(remainders).unwrap();
let coder3 = ChainCoder::from_remainders(remainders_suffix).unwrap();

for (mut coder, prefix) in vec![
for (mut coder, prefix) in [
(coder, vec![]),
(coder2, vec![]),
(coder3, remainders_prefix),
Expand Down
2 changes: 1 addition & 1 deletion src/stream/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4246,7 +4246,7 @@ mod tests {
#[test]
fn lookup_noncontiguous() {
let symbols = "axcy";
let probabilities = vec![3u8, 18, 1, 42];
let probabilities = [3u8, 18, 1, 42];
let encoder_model = NonContiguousCategoricalEncoderModel::<_, u8, 6>::from_symbols_and_nonzero_fixed_point_probabilities(
symbols.chars(),probabilities.iter(),false
)
Expand Down
6 changes: 3 additions & 3 deletions tests/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ fn example() {

// Define some data and a sequence of entropy models. We use quantized Gaussians
// here, but you could also use other models or even implement your own.
let symbols = vec![23i32, -15, 78, 43, -69];
let symbols = [23i32, -15, 78, 43, -69];
let quantizer = DefaultLeakyQuantizer::new(-100..=100);
let means = vec![35.2f64, -1.7, 30.1, 71.2, -75.1];
let stds = vec![10.1f64, 25.3, 23.8, 35.4, 3.9];
let means = [35.2f64, -1.7, 30.1, 71.2, -75.1];
let stds = [10.1f64, 25.3, 23.8, 35.4, 3.9];
let models = means.iter().zip(&stds).map(|(&mean, &std)| {
quantizer.quantize(probability::distribution::Gaussian::new(mean, std))
});
Expand Down

0 comments on commit 93b8fa6

Please sign in to comment.