Add rna module and format with rustfmt
@@ -22,6 +22,7 @@ use vec_map::VecMap;
use utils::{IntoTextIterator, TextIterator};
pub mod dna;
+pub mod rna;
pub mod protein;
pub type SymbolRanks = VecMap<u8>;
@@ -49,8 +50,7 @@ impl Alphabet {
/// Check if given text is a word over the alphabet.
pub fn is_word<'a, T: IntoTextIterator<'a>>(&self, text: T) -> bool {
- text.into_iter()
- .all(|&c| self.symbols.contains(c as usize))
+ text.into_iter().all(|&c| self.symbols.contains(c as usize))
}
/// Return lexicographically maximal symbol.
@@ -90,9 +90,7 @@ impl RankTransform {
/// Get the rank of symbol `a`.
pub fn get(&self, a: u8) -> u8 {
- *self.ranks
- .get(a as usize)
- .expect("Unexpected character.")
+ *self.ranks.get(a as usize).expect("Unexpected character.")
}
/// Transform a given `text`.
