From 2d163cfc6c02f8e8b6ac2044a860a4c0a3f5da93 Mon Sep 17 00:00:00 2001 From: Eli Flanagan Date: Thu, 18 Jun 2020 01:52:18 -0400 Subject: [PATCH] synchronize example with src/lib.rs (#956) Made plural to match lib/rs. --- exercises/protein-translation/example.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/protein-translation/example.rs b/exercises/protein-translation/example.rs index 8cdf34da7..38d7da580 100644 --- a/exercises/protein-translation/example.rs +++ b/exercises/protein-translation/example.rs @@ -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() }