From 18c83b9f7ce336d297312d7fd4a1aa825f53d5df Mon Sep 17 00:00:00 2001 From: Steve Wooster Date: Mon, 29 Jan 2024 12:37:15 -0800 Subject: [PATCH] Appease clippy * Use `Vec::with_capacity` instead of `Vec::reserve` where appropriate * Don't import * from `python_api` when it doesn't have anything to import. --- src/lib.rs | 3 --- src/rust_api.rs | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 08314b3..531f6d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,9 +27,6 @@ pub use rust_api::*; #[cfg(feature = "python-support")] mod python_api; -#[cfg(feature = "python-support")] -pub use python_api::*; - #[cfg(any(feature = "quickcheck", test))] mod quickcheck; diff --git a/src/rust_api.rs b/src/rust_api.rs index 00fe78f..f52f217 100644 --- a/src/rust_api.rs +++ b/src/rust_api.rs @@ -311,9 +311,7 @@ impl TryFrom<&[u8]> for DnaSequence { type Error = TranslationError; fn try_from(value: &[u8]) -> Result { - let mut vec = vec![]; - vec.reserve(value.len()); - + let mut vec = Vec::with_capacity(value.len()); for &b in value { if b != b' ' && b != b'\t' { vec.push(T::try_from(b)?);