Skip to content

Commit

Permalink
Appease clippy
Browse files Browse the repository at this point in the history
* Use `Vec::with_capacity` instead of `Vec::reserve` where appropriate
* Don't import * from `python_api` when it doesn't have anything to import.
  • Loading branch information
swooster committed Jan 29, 2024
1 parent 0d015f2 commit 18c83b9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions src/rust_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,7 @@ impl<T: NucleotideLike> TryFrom<&[u8]> for DnaSequence<T> {
type Error = TranslationError;

fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
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)?);
Expand Down

0 comments on commit 18c83b9

Please sign in to comment.