Skip to content

Commit ed43486

Browse files
authored
Merge branch 'master' into add-euler-totient-function
2 parents 6e1ce73 + ba3f671 commit ed43486

File tree

8 files changed

+7
-9
lines changed

8 files changed

+7
-9
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ cast_precision_loss = { level = "allow", priority = 1 }
3131
cast_sign_loss = { level = "allow", priority = 1 }
3232
cloned_instead_of_copied = { level = "allow", priority = 1 }
3333
doc_markdown = { level = "allow", priority = 1 }
34-
enum_glob_use = { level = "allow", priority = 1 }
3534
explicit_deref_methods = { level = "allow", priority = 1 }
3635
explicit_iter_loop = { level = "allow", priority = 1 }
3736
float_cmp = { level = "allow", priority = 1 }
@@ -166,6 +165,5 @@ doc_lazy_continuation = { level = "allow", priority = 1 }
166165
needless_return = { level = "allow", priority = 1 }
167166
doc_overindented_list_items = { level = "allow", priority = 1 }
168167
# complexity-lints
169-
needless_lifetimes = { level = "allow", priority = 1 }
170168
precedence = { level = "allow", priority = 1 }
171169
manual_div_ceil = { level = "allow", priority = 1 }

src/ciphers/transposition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn decrypt(mut msg: String, key_order: Vec<usize>) -> String {
161161

162162
for key in key_order {
163163
if let Some((_, column)) = indexed_vec.iter().find(|(key_index, _)| key_index == &key) {
164-
decrypted_vec.push(column.to_string());
164+
decrypted_vec.push(column.clone());
165165
}
166166
}
167167

src/data_structures/binary_search_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ where
184184
stack: Vec<&'a BinarySearchTree<T>>,
185185
}
186186

187-
impl<'a, T> BinarySearchTreeIter<'a, T>
187+
impl<T> BinarySearchTreeIter<'_, T>
188188
where
189189
T: Ord,
190190
{

src/data_structures/veb_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a> VebTreeIter<'a> {
221221
}
222222
}
223223

224-
impl<'a> Iterator for VebTreeIter<'a> {
224+
impl Iterator for VebTreeIter<'_> {
225225
type Item = u32;
226226

227227
fn next(&mut self) -> Option<u32> {

src/math/interquartile_range.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn find_median(numbers: &[f64]) -> f64 {
1313
let mid = length / 2;
1414

1515
if length % 2 == 0 {
16-
(numbers[mid - 1] + numbers[mid]) / 2.0
16+
f64::midpoint(numbers[mid - 1], numbers[mid])
1717
} else {
1818
numbers[mid]
1919
}

src/math/perfect_square.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn perfect_square_binary_search(n: i32) -> bool {
1818
let mut right = n;
1919

2020
while left <= right {
21-
let mid = (left + right) / 2;
21+
let mid = i32::midpoint(left, right);
2222
let mid_squared = mid * mid;
2323

2424
match mid_squared.cmp(&n) {

src/math/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl PCG32 {
107107
}
108108
}
109109

110-
impl<'a> Iterator for IterMut<'a> {
110+
impl Iterator for IterMut<'_> {
111111
type Item = u32;
112112
fn next(&mut self) -> Option<Self::Item> {
113113
Some(self.pcg.get_u32())

src/sorting/dutch_national_flag_sort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub enum Colors {
1111
White, // | Define the three colors of the Dutch Flag: 🇳🇱
1212
Blue, // /
1313
}
14-
use Colors::*;
14+
use Colors::{Blue, Red, White};
1515

1616
// Algorithm implementation
1717
pub fn dutch_national_flag_sort(mut sequence: Vec<Colors>) -> Vec<Colors> {

0 commit comments

Comments
 (0)