From 737370d87ba8d91a4a11f3276b1d21a792e3e684 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 4 Sep 2023 18:52:16 +0800 Subject: [PATCH] Fix typo --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b0f985..dee8c6f 100644 --- a/README.md +++ b/README.md @@ -212,14 +212,14 @@ impl RemoteI18n { } impl Backend for RemoteI18n { - fn available_locales(&self) -> Vec { - 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 { + 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); } } ```