Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee authored Sep 4, 2023
1 parent 8ac1bc8 commit 737370d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ impl RemoteI18n {
}
impl Backend for RemoteI18n {
fn available_locales(&self) -> Vec<String> {
return self.trs.keys().cloned().collect();
fn available_locales(&self) -> Vec<&str> {
return self.trs.keys().collect();
}
fn translate(&self, locale: &str, key: &str) -> Option<String> {
fn translate(&self, locale: &str, key: &str) -> Option<&str> {
// Write your own lookup logic here.
// For example load from database
return self.trs.get(locale)?.get(key).cloned();
return self.trs.get(locale)?.get(key);
}
}
```
Expand Down

0 comments on commit 737370d

Please sign in to comment.