diff --git a/Cargo.toml b/Cargo.toml index 3c321165..7428a0bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["metagenomics", "transcriptonomics", "bio", "DNA", "unipept"] categories = ["command-line-utilities", "science"] license = "MIT" include = ["Cargo.toml", "LICENSE", "README.md", "scripts/umgap*.sh", "src/**/*.rs"] -edition = "2018" +edition = "2024" rust-version = "1.88" [dependencies] diff --git a/src/commands/snaptaxon.rs b/src/commands/snaptaxon.rs index 42a95156..3f56b667 100644 --- a/src/commands/snaptaxon.rs +++ b/src/commands/snaptaxon.rs @@ -7,8 +7,8 @@ use std::path::PathBuf; use std::str::FromStr; -use clap::builder::{PossibleValuesParser, TypedValueParser}; use clap::Args; +use clap::builder::{PossibleValuesParser, TypedValueParser}; use crate::errors; use crate::rank; diff --git a/src/commands/taxa2agg.rs b/src/commands/taxa2agg.rs index be1335d0..4a433164 100644 --- a/src/commands/taxa2agg.rs +++ b/src/commands/taxa2agg.rs @@ -6,8 +6,8 @@ use std::path::PathBuf; use std::str::FromStr; use crate::agg; -use clap::builder::{PossibleValuesParser, TypedValueParser}; use clap::Args; +use clap::builder::{PossibleValuesParser, TypedValueParser}; use crate::errors; use crate::io::fasta; diff --git a/src/commands/taxa2freq.rs b/src/commands/taxa2freq.rs index 6a01b861..0e7a114d 100644 --- a/src/commands/taxa2freq.rs +++ b/src/commands/taxa2freq.rs @@ -10,8 +10,8 @@ use std::path::PathBuf; use std::str::FromStr; -use clap::builder::{PossibleValuesParser, TypedValueParser}; use clap::Args; +use clap::builder::{PossibleValuesParser, TypedValueParser}; use crate::errors; use crate::rank; diff --git a/src/commands/translate.rs b/src/commands/translate.rs index 17e49810..40ee93ce 100644 --- a/src/commands/translate.rs +++ b/src/commands/translate.rs @@ -4,10 +4,10 @@ use std::fmt; use std::io; use std::str::FromStr; -use crate::dna::translation::TranslationTable; use crate::dna::Strand; -use clap::builder::{PossibleValuesParser, TypedValueParser}; +use crate::dna::translation::TranslationTable; use clap::Args; +use clap::builder::{PossibleValuesParser, TypedValueParser}; use crate::errors; use crate::io::fasta; @@ -128,10 +128,12 @@ pub fn translate(args: Translate) -> errors::Result<()> { } else { header.clone() + "|" + &name.to_string() }, - sequence: vec![String::from_utf8( - table.translate_frame(args.methionine, strand.frame(frame)), - ) - .unwrap()], + sequence: vec![ + String::from_utf8( + table.translate_frame(args.methionine, strand.frame(frame)), + ) + .unwrap(), + ], })?; } } diff --git a/src/dna/translation.rs b/src/dna/translation.rs index 3260b8a1..40c4ce13 100644 --- a/src/dna/translation.rs +++ b/src/dna/translation.rs @@ -124,11 +124,7 @@ impl TranslationTable { /// Translate the given codon to an AA. Translate each start codon to methionine if asked. pub fn translate(&self, methionine: bool, codon: &Codon) -> u8 { let &(start, codon) = self.table.get(codon).unwrap_or(&(false, b'-')); - if start && methionine { - b'M' - } else { - codon - } + if start && methionine { b'M' } else { codon } } /// Translate the given DNA frame to a peptide. Translate each start codon to methionine if