diff --git a/Cargo.toml b/Cargo.toml index c848f37344c..e06b115f443 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -167,6 +167,7 @@ doc_lazy_continuation = { level = "allow", priority = 1 } needless_return = { level = "allow", priority = 1 } doc_overindented_list_items = { level = "allow", priority = 1 } needless_range_loop = { level = "allow", priority = 1 } +doc_paragraphs_missing_punctuation = { level = "allow", priority = 1 } # complexity-lints precedence = { level = "allow", priority = 1 } manual_div_ceil = { level = "allow", priority = 1 } diff --git a/src/data_structures/binary_search_tree.rs b/src/data_structures/binary_search_tree.rs index 05e8614ea1a..5ff05f432ea 100644 --- a/src/data_structures/binary_search_tree.rs +++ b/src/data_structures/binary_search_tree.rs @@ -212,8 +212,8 @@ where None } else { let node = self.stack.pop().unwrap(); - if node.right.is_some() { - self.stack.push(node.right.as_ref().unwrap().deref()); + if let Some(right_node) = &node.right { + self.stack.push(right_node.deref()); self.stack_push_left(); } node.value.as_ref() diff --git a/src/lib.rs b/src/lib.rs index 2267721cc11..c913a5b8714 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,22 +19,3 @@ pub mod searching; pub mod signal_analysis; pub mod sorting; pub mod string; - -#[cfg(test)] -mod tests { - use super::sorting; - #[test] - fn quick_sort() { - //descending - let mut ve1 = vec![6, 5, 4, 3, 2, 1]; - sorting::quick_sort(&mut ve1); - - assert!(sorting::is_sorted(&ve1)); - - //pre-sorted - let mut ve2 = vec![1, 2, 3, 4, 5, 6]; - sorting::quick_sort(&mut ve2); - - assert!(sorting::is_sorted(&ve2)); - } -}