Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ wildcard_enum_match_arm = { level = "allow", priority = 1 }
needless_for_each = { level = "allow", priority = 1 }
inline_modules = { level = "allow", priority = 1 }
inline_trait_bounds = { level = "allow", priority = 1 }
definition_in_module_root = { level = "allow", priority = 1 }
rest_pattern_accessible_field = { level = "allow", priority = 1 }
# style-lints:
doc_lazy_continuation = { level = "allow", priority = 1 }
doc_overindented_list_items = { level = "allow", priority = 1 }
Expand Down
2 changes: 1 addition & 1 deletion src/dynamic_programming/fibonacci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub fn binary_lifting_fibonacci(n: u32) -> u128 {
// the state always stores F(k), F(k+1) for some k, initially F(0), F(1)
let mut state = (0u128, 1u128);

for i in (0..u32::BITS - n.leading_zeros()).rev() {
for i in (0..n.bit_width()).rev() {
// compute F(2k), F(2k+1) from F(k), F(k+1)
state = (
state.0 * (2 * state.1 - state.0),
Expand Down
1 change: 0 additions & 1 deletion src/machine_learning/support_vector_classifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
//! ```

use ndarray::{Array1, Array2};
use std::f64;

/// Kernel types supported by the SVC
#[derive(Debug, Clone)]
Expand Down
3 changes: 1 addition & 2 deletions src/math/miller_rabin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ pub fn big_miller_rabin(number_ref: &BigUint, bases: &[u64]) -> u64 {
panic!("0 is invalid input for Miller-Rabin. 0 is not prime by definition, but has no witness");
} else if number.eq(&BigUint::from(2u32)) || number.eq(&BigUint::from(3u32)) {
return 0;
} else {
return number.to_u64().unwrap();
}
return number.to_u64().unwrap();
}

if let Some(num) = number.to_u64() {
Expand Down
Loading