Skip to content

Commit

Permalink
synchronize example with src/lib.rs (#956)
Browse files Browse the repository at this point in the history
Made plural to match lib/rs.
  • Loading branch information
efx authored Jun 18, 2020
1 parent 1fdca20 commit 2d163cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exercises/protein-translation/example.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use std::collections::HashMap;

pub struct CodonInfo<'a> {
pub struct CodonsInfo<'a> {
actual_codons: HashMap<&'a str, &'a str>,
}

pub fn parse<'a>(pairs: Vec<(&'a str, &'a str)>) -> CodonInfo<'a> {
CodonInfo {
pub fn parse<'a>(pairs: Vec<(&'a str, &'a str)>) -> CodonsInfo<'a> {
CodonsInfo {
actual_codons: pairs.into_iter().collect(),
}
}

impl<'a> CodonInfo<'a> {
impl<'a> CodonsInfo<'a> {
pub fn name_for(&self, codon: &str) -> Option<&'a str> {
self.actual_codons.get(&codon).cloned()
}
Expand Down

0 comments on commit 2d163cf

Please sign in to comment.